HostCMS писал(а):
Оставьте последний ->clearOrderBy(), у вас их почему-то два, а также ->orderBy('shop_items.shop_group_id'

поменяйте на ->orderBy('shop_groups.sorting'

Не помогло:
$aForbiddenGroupTags = array('description', 'seo_title', 'seo_description', 'seo_keywords', 'image_large', 'image_large_height', 'image_small', 'image_large_width', 'image_small_height', 'image_small_width', 'subgroups_count', 'subgroups_total_count', 'items_count', 'items_total_count', 'guid', 'dir', 'user_id', 'siteuser_group_id', 'indexing', 'sorting', 'deleted', 'date');
$oShop = Core_Entity::factory('Shop', Core_Array::get(Core_Page::instance()->libParams, 'shopId'));
$xsl_count = Core_Array::get(Core_Page::instance()->libParams, 'xsl_count');
$Shop_Controller_Show = new Shop_Controller_Show($oShop);
$path = Core_Page::instance()->structure->getPath();
$Shop_Controller_Show
->pattern($path . '({path})(page-{page}/)')
->addEntity(
Core::factory('Core_Xml_Entity')
->name('path')
->value($path)
)
->limit($xsl_count)
->parseUrl();
$Shop_Controller_Show
->shopItems()
->queryBuilder()
->clearOrderBy()
->leftJoin('shop_groups', 'shop_groups.id', '=', 'shop_items.shop_group_id')
->where('shop_items.active', '=', 1)
->open()
->where('shop_groups.active', '=', 1)
->setOr()
->where('shop_groups.active', 'IS', NULL)
->where('shop_items.modification_id', '=', 0)
->close()
->clearOrderBy()
->orderBy('shop_groups.sorting');
$Shop_Controller_Show
->shopGroups()
->queryBuilder()
->where('shop_groups.active', '=', 1);
$xslName = Core_Array::get(Core_Page::instance()->libParams, 'xsl');
$Shop_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName($xslName)
)
->groupsMode('all')
->groupsForbiddenTags($aForbiddenGroupTags)
->itemsProperties(TRUE)
->itemsPropertiesList(FALSE)
->group(FALSE)
->votes(FALSE)
->siteuser(FALSE)
->viewed(FALSE)
->forbidSelectModifications()
->limit(100)
->show();