I'm trying to modify items in a collection on page load (catalog) and using the event:
and the code for the event is :
$observer->getCollection() ->addFieldToFilter('entity_id', array('nin' => array_keys($_excludeProducts))) ->clear() ->load();
this does exclude product(s) but the count is wrong. like there're 5 products in the collection and on the grid as well but the count is 6 items. How can i correct this?
getSize()and I'm not too sure about
count()so it makes sense. A solution I don't have for you at this moment
load_after? Even if Magento is smart enough to not go into endless recursion, why don't you use
load_beforeto add the field to filter?
load()in the observer, which you should not and need not then
load_beforein event didn't help either.