Skip to main content
deleted 26 characters in body; edited title
Source Link
brentwpeterson
  • 6.1k
  • 8
  • 44
  • 81

magento Magento 1.9.1 display subcategory image beside in navigation dropdown

Hi i'm new with magento. II 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>';

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

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

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

Magento 1.9.1 display subcategory image beside in navigation dropdown

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

added 30 characters in body
Source Link
dh47
  • 1.7k
  • 1
  • 18
  • 31

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() );

$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[] = '' . $this->escapeHtml($category->getName()) . ''; $html[] = '';

$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

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[] = '' . $this->escapeHtml($category->getName()) . ''; $html[] = '';

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

How do i fetch the image url to show 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

Source Link

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[] = '' . $this->escapeHtml($category->getName()) . ''; $html[] = '';

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

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