Skip to main content
2 of 3
added 30 characters in body
dh47
  • 1.7k
  • 1
  • 18
  • 31

magento 1.9.1 display subcategory image beside in navigation dropdown

Hi i'm new with magento. I want to show category(subcategory) image beside my main navigation dropdown. I have tried with following script

I just copied the Observer.php and Navigation.php from app\code\core\Mage\Catalog\

to my local(app\code\local\Mage\Catalog)

and in observer.php i added the line in function(_addCategoriesToMenu)

$categoryData = array(
                'image_url' => $category->getThumbnail(),
                 '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())->getThumbnail()
             );

and in navigation.php (_renderCategoryMenuItemHtml)

$html[] = '<a href="' . $this->getCategoryUrl($category) . '"' .
 $linkClass . '>'; $html[] = '<span>' .
 $this->escapeHtml($category->getName()) . '</span>'; $html[] = '</a>';

i can not found the image url by this function $category->getThumbnail();

How do i fetch the image url to show in navigation dropdown