Код: Выделить всё
public function drawMenuItem($children, $level = 1)
{
$html = '';
$keyCurrent = $this->getCurrentCategory()->getId();
foreach ($children as $child) {
if (is_object($child) && $child->getIsActive()) {
// --- class for active category ---
$active = '';
if ($this->isCategoryActive($child)) {
$active = ' actParent';
if ($child->getId() == $keyCurrent) $active = ' act';
}
// --- format category name ---
$name = $this->escapeHtml($child->getName());
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
$html.= '' . $name . '';
$activeChildren = $this->_getActiveChildren($child, $level);
if (count($activeChildren) > 0) {
$html.= '';
$html.= $this->drawMenuItem($activeChildren, $level + 1);
$html.= '';
}
}
}
$html.= '';
return $html;
}
Подробнее здесь: https://stackoverflow.com/questions/294 ... in-magento