Category Name Magento
Hello all,
I am writing here the code for getting category information of the known category id.
<?php $catagory_model = Mage::getModel('catalog/category'); $categories = $catagory_model->load($id); // where $id will be the known category id if(!empty($categories)) { 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”
Comments are closed.
Thanks for valuable post
That very used full.
Thanks great job done by you
This returns everything except the imageUrl for me… any ideas why?
@caedmon – Can you please post your code here for reference
Thanks great job done by you. After investing whole day i got the solution. Thanks againg
Praveen
Thanks a lot overall i got the solution after investing all day. thanks again
How to get caterory id from category name in magento.
I know the category name. I have to fetch it’s id and subcategories.
Please help
@Dipannita –
Suppose name of the category is ‘Magento’ (excluding quotes).
So for getting category id you need to use this code
For sub categories refer this post of mine – http://blog.decryptweb.com/child-categories-magento/
Hope this helps you.