Currently I have this to get children of a category:
$category = Mage::getModel('catalog/category')->load($categoryId);
$childrenIds = $category->getResource()->getChildren($category, true);
However, it will get only active children. Is there a way to get all children of a specific category, including disabled categories?
Best Answer
user76757,You
cannot get inactive because of Flat system is enable for category
. The setting is enable at admin In order to see this option, go toMagento admin section and click on: System -> Config -> Catalog and Frontend. "Use Flat Catalog Product". make it No then indexing from index management
.There fore you can all inactive category.Magento is use the flat system for product and category,instead of taking the eav data from one table the data is taken from one table.see at http://inchoo.net/magento/flat-tables-in-magento-and-product-collection/
You can the code how magento write it logic. File:app/code/core/Mage/Catalog/Model/Category.php
So you can not get disable categories when flat enable .
Alternative Solution: for getting
inactive and active children categories
try this$category->getChildrenCategoriesWithInactive();
See Alan Strom blog