Category Name Magento

Hello all,

I am writing here the code for getting category information of the known category id.

	$catagory_model = Mage::getModel('catalog/category');
	$categories = $catagory_model->load($id); // where $id will be the known category id 
	    echo 'category name->'.$categories->getName(); //get category name	    		
	    echo 'category image url->'.$categories->getImageUrl(); //get category image url
	    echo 'category url path->'.$categories->getUrlPath(); //get category url path

Hope this is helpful

9 thoughts on “Category Name Magento

    1. @Dipannita –
      Suppose name of the category is ‘Magento’ (excluding quotes).
      So for getting category id you need to use this code

      //get category model
      $category_model = 
      echo 'Category ID -> '.$category_model->getId(); //get category id

      For sub categories refer this post of mine –
      Hope this helps you.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top