8

As we know that in the Category Management page we can upload an image and give a URL for each category. I want to retrieve the Category name, Category URL and Category image using only the Category Id that I already have with me. Is it possible to do so?

2 Answers 2

14

Ravi Chan,you can only do this Magento Category Model Call.

$Category=Mage::getModel('catalog/category')->load($cat);
$name=$Category->getName();
$url=$Category->getUrl();
$image=$Category->getImageUrl()
2
  • 1
    What about retrieving the image?
    – Ravi Chan
    Commented Feb 20, 2015 at 5:19
  • 1
    wait.....................
    – Amit Bera
    Commented Feb 20, 2015 at 5:20
-1

Try this:

<img src="<?php echo Mage::helper('catalog/image')->init($_product, 'small_image')->resize(197, 167); ?>" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.