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?

1 Answer 1


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 to Magento 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

 protected function _construct()
    // If Flat Data enabled then use it but only on frontend
    $flatHelper = Mage::helper('catalog/category_flat');
    if ($flatHelper->isAvailable() && !Mage::app()->getStore()->isAdmin() && $flatHelper->isBuilt(true)
        && !$this->getDisableFlat()
    ) {
        $this->_useFlatResource = true;
    } else {

So you can not get disable categories when flat enable .

Alternative Solution: for getting inactive and active children categories try this


See Alan Strom blog

  • $allChildren = $category->getChildrenCategoriesWithInactive()
    – ProxiBlue
    Commented Mar 18, 2017 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.