1

I would like to exclude a number of child categories from my catalogue collection in order to amend a mega menu I am creating.

I have tried the following:

$subAcc = $acc->getChildrenCategories();
$subAcc->addAttributeToFilter('category_id', array('nin' => array(321, 322)));

But this errors. What is the correct way to do this?

1
  • use entity_id instead of category_id
    – Amit Bera
    Jan 19, 2015 at 14:57

1 Answer 1

1

Just change category_id to entity_id and code:

$subAcc = $acc->getChildrenCategories();
$subAcc->addAttributeToFilter('entity_id', array('nin' => array(321, 322)));

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.