Is the more native way of adding parent filter on a category collection other than a direct where showcased below?

/** @var Mage_Catalog_Model_Resource_Category_Collection $categoryCollection */
$categoryCollection = Mage::getResourceModel('catalog/category_collection');
$categoryCollection->getSelect()->where('e.parent_id = ' . $parentId);

1 Answer 1


Sound too easy, but isn't it same as :)

$categoryCollection = Mage::getResourceModel('catalog/category_collection');
$categoryCollection->addFieldToFilter('parent_id', $parentId);
  • @TimBezhashvyly Yes, of course :)
    – sv3n
    Feb 4, 2018 at 17:56
  • @TimBezhashvyly I also checked if something changed from to 1.9.3.x ... but no, this should work with 1.9.2 too.
    – sv3n
    Feb 5, 2018 at 13:44

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.