If you enable the flat categories in your Magento store, some code that gets children of a given category might stop working. The following code can be used to get all the cildren of a given category with enabled flat categories:
1 2 3 4 5 |
$category = Mage::getModel('catalog/category')->load($id); $childCategories = $category ->getCollection() ->addAttributeToSelect(array('name', 'image', 'description')) ->addIdFilter($category->getChildren()); |
Getting child categories with flat categories enabled
You want or need help implementing this solution? Maybe you did not find what you were looking for? Contact me and I will assist you with whatever Magento problem troubles you!