Display all the subcategories of any category in Magento.
If you have a category ID (current category OR any category) then you can easily display all the subcategories of that particular category.
Below code will load all the subcategories of the current category.
If you want to get all the subcategories of any specific category, so assign category id in $categoryID.
<?php
$catID = $current_category->getId(); //or any specific category id, e.g. 5
$children = Mage::getModel('catalog/category')->getCategories($catID);
foreach ($children as $category)
{
echo $category->getId();
echo $category->getName();
echo $category->getRequestPath();
print_r($category->getData());
}
?>
I was looking for this kind of blogs of getting subcategories of current which is very useful. keep updating the post.
ReplyDeletebuy neelambri sapphire online
Really good to know about the subcategories of the current category. Thanks for sharing this post and keep updating.
ReplyDeletecoenzyme q10 supplement
Really impressive post, thanks for it.
ReplyDeleteAbdominal Pain treatment in delhi