How to Check Current Category has Child Category or not in Magento
In this post i will show you how you can get the list of subcategories of a category.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?php $layer = Mage::getSingleton('catalog/layer'); $Category = $layer->getCurrentCategory(); $parentCategoryId = $Category ->getId(); //will give current category id; $categories = Mage::getModel('catalog/category')->load($parentCategoryId)->getChildren(); if(!empty($categories)) { echo "Has Child Category"; } else { echo "Not have any Child Category"; } ?> |
[paypal-donation]