How to get sub-category by category id in Magento
Try to use below code for subcategories in magento
$subcategoryCollection = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToFilter('parent_id', 35);
foreach($subcategoryCollection as $_subcategoryCollection)
{
$categoryId = $_subcategoryCollection->getEntityId();
$categoryName = Mage::getModel('catalog/category')->load($categoryId);
$categoryName->getName();
}
2 comments:
How to get sub-category by category id in Magento
nice.
Post a Comment