0

I am using pcarousel extension in AccessShop theme for my store.

I am going to use multiple carousels for categories on homepage.

How to show category name in category carousels for home page?

1
$category_id = 5;
$_category = Mage::getModel('catalog/category')->load($category_id);
$category_name = $_category->getName();

Mage::getModel('catalog/category')->load($category_id) -> load category by id so that all attribute of category value you can get.
$category_name = $_category->getName(); -> Here with get method you get name of category.

| improve this answer | |
  • Could you please add some explanation about your code? – 7ochem Jul 29 '16 at 12:00
  • Mage::getModel('catalog/category')->load($category_id) -> load category by id so that all attribute of category value you can get. $category_name = $_category->getName(); -> Here with get method you get name of category. – Prashant Barot Jul 29 '16 at 12:04
  • Thanks @Prashant Barot, It worked! I used it like : <?php $cruid = $this->getPcarouselId(); $crudata = Mage::getModel('pcarousel/pcarousel')->load($cruid)->getData(); $categoryid = $crudata['categories']; //Category Name $_category = Mage::getModel('catalog/category')->load($categoryid); $category_name = $_category->getName(); ?> – Vee Jul 29 '16 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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