Saturday 13 February 2016

How to get category name by category id in Magento

Display category name by category id in Magento.


<?php
     
        $categoryId = 5;      //  Change category id according to you


  // display name and other detail of all category       

  $_category = Mage::getModel('catalog/category')->load($categoryId);



// category name 

echo $categoryName = $_category->getName();
 


// category description 

echo $categoryDescription = $_category->getDescription();

 


// category url 

echo $categoryUrl = $_category->getUrl();

   


// category thumbnail 

echo $categoryThumbnail = $_category->getThumbnail();

 


// category level 

echo $categoryLevel = $_category->getLevel();

 


// parent category

echo $parentCategoryId = $_category->getParentId();


?>








6 comments:

  1. This post is very nice and very impressive. This post is pretty well maintained and very informative. Thanks for this post, keep updating.
    CR Coil In Haryana

    ReplyDelete
  2. Its really good to know about to get category name by category id in magento. Very informative post. Really appreciated, Keep updating.
    underarm whitening and smoothing lotion

    ReplyDelete
  3. It's a very well maintained post with the important information. Thanks for this kind of posts. Keep updating.
    hoverboard india

    ReplyDelete