можно через хук
Core_Event::attach('Shop_Controller_Show.onBeforeShow', function(Shop_Controller_Show $oController) {
$iCurGroup = $oController->group;
if (is_int($iCurGroup) && $iCurGroup > 0) {
$aGroups = $oController->getShopGroups();
if (isset($aGroups[$iCurGroup]) && count($aGroups[$iCurGroup] > 0)) {
$aIDS = array();
foreach ($aGroups[$iCurGroup] as $oGroup) {
$aIDS[] = $oGroup->id;
}
$oShopGroups = $oController->getEntity()->shop_groups;
$oShopGroups->queryBuilder()
->where('parent_id', 'IN', $aIDS)
->where('active', '=', 1);
$aShopGroups = $oShopGroups->findAll();
if (count($aShopGroups)) {
$oGroupsXML = Core::factory('Core_Xml_Entity')->name('subgroups');
foreach ($aShopGroups as $oShopGroup) {
$oShopGroup->clearEntities();
$oGroupsXML->addEntity($oShopGroup);
}
$oController->addEntity($oGroupsXML);
}
}
}
});