Question

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?

Was it helpful?

Solution

Just change category_id to entity_id and code:

$subAcc = $acc->getChildrenCategories();
$subAcc->addAttributeToFilter('entity_id', array('nin' => array(321, 322)));
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top