2

I am trying to update my layered-navigation on the left sidebar after applying

$_productCollection = clone $this->getLoadedProductCollection();
$_productCollection->clear()->addAttributeToFilter('name', array('like' => "justtesting"))->load();

to my list.phtml. But it seems that Magento only displays the correct filters for the default product collection. Is there a opportunity to update the filter navi on the left side? Any help would be appreciated!

chrjng
  • 71
  • 1
  • 7

1 Answers1

0

It looks like you are making a copy of the collection since you used clone. You may be able to affect the template this way, but any changes you make to your copy of the collection are not going to affect the source of the collection.

If you need to perform additional logic on the collection, you should extend Mage_Catalog_Block_Product_List::_getProductCollection() and add your modifications to the collection it returns (i.e. parent::_getProductCollection()). Beyond that, your question is too broad to be more specific.

You can also add new attributes to filter using Magento’s built-in attribute management.

fantasticrice
  • 1,631
  • 1
  • 21
  • 31