1
votes

I'm trying to modify Magento (1.7.0.2) collection to show only grouped products in the product list. I've tried to do this with addAttributeToSelect or addAttributeToFilter like this

$_productCollection=$this ->getLoadedProductCollection()
->addAttributeToSelect('*')->addAttributeToFilter('type_id','grouped');

or

$_productCollection=$this ->getLoadedProductCollection()
->addAttributeToFilter('type_id', array('eq' => 'grouped'));

but it's not working now with this version of Magento.

Anybody knows how can I get it working?

1

1 Answers

1
votes

Filters not being applied often happens when the production is already loaded.

Try doing a $_productCollection->clear() before you iterate across the collection. Preferably though, find a place to update the collection before it is loaded.