Showing posts with label How to get category name by category id in Magento. Show all posts
Showing posts with label How to get category name by category id in Magento. Show all posts

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


?>