app\code\local\Mage\Catalog\Model\Observer.php
find function _addCategoriesToMenu()
replace
$categoryData = array(
'name' => $category->getName(),
'id' => $nodeId,
'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
'is_active' => $this->_isActiveMenuCategory($category),
'thumbnail' => Mage::getModel('catalog/category')->load($category->getId())->getImage()
);
app\code\local\Mage\Page\Block\Html\Topmenu.php
find function getHtml()
remove
if ($renderer = $this->getChild('catalog.topnav.renderer')) {
$renderer->setMenuTree($this->_menu)->setChildrenWrapClass($childrenWrapClass);
$html = $renderer->toHtml();
} else {
$html = $this->_getHtml($this->_menu, $childrenWrapClass);
}
add
$html = $this->_getHtml($this->_menu, $childrenWrapClass);
and in _getHtml()
replace
$parentLevels = $child->getLevel();
$urls = Mage::getBaseUrl('media').'catalog/category/'.$child->getData('thumbnail');
$img = '<img src="'.$urls.'" />';
$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
. $this->escapeHtml($child->getName()) . ' </span> </a>';
find function _addCategoriesToMenu()
replace
$categoryData = array(
'name' => $category->getName(),
'id' => $nodeId,
'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
'is_active' => $this->_isActiveMenuCategory($category),
'thumbnail' => Mage::getModel('catalog/category')->load($category->getId())->getImage()
);
app\code\local\Mage\Page\Block\Html\Topmenu.php
find function getHtml()
remove
if ($renderer = $this->getChild('catalog.topnav.renderer')) {
$renderer->setMenuTree($this->_menu)->setChildrenWrapClass($childrenWrapClass);
$html = $renderer->toHtml();
} else {
$html = $this->_getHtml($this->_menu, $childrenWrapClass);
}
add
$html = $this->_getHtml($this->_menu, $childrenWrapClass);
and in _getHtml()
replace
$parentLevels = $child->getLevel();
$urls = Mage::getBaseUrl('media').'catalog/category/'.$child->getData('thumbnail');
$img = '<img src="'.$urls.'" />';
$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
. $this->escapeHtml($child->getName()) . ' </span> </a>';
Comments
Post a Comment