Roman Fov,
можно
/**
* Ограничение уровня вложенности групп в режиме генерации 'all'
*/
class My_Shop_Controller_Show extends Shop_Controller_Show
{
protected $_level = NULL;
protected $_currentLevel = 0;
public function level($level)
{
$this->_level = $level;
$this->addCacheSignature('level=' . $this->_level);
return $this;
}
public function show()
{
$this->_currentLevel = 0;
return parent::show();
}
protected function _addGroupsByParentId($parent_id, $parentObject)
{
$this->_currentLevel++;
if ($this->_currentLevel <= $this->_level)
{
parent::_addGroupsByParentId($parent_id, $parentObject);
}
$this->_currentLevel--;
return $this;
}
}
$Shop_Controller_Show = new My_Shop_Controller_Show(
Core_Entity::factory('Shop', 1)
);
$Shop_Controller_Show
->xsl(
Core_Entity::factory('Xsl')->getByName('МагазинГруппыТоваровНаГлавной')
)
->groupsMode('all')
->level(4)
->group(0)
->limit(0)
->show();