I am writing a block which subclasses Mage_Catalog_Block_Layer_Filter_Category
to display a list of products in each category. To do this I apply addCategoryFilter()
to the layer product collection for each layer filter item, first using clear()
to remove any other filters. So I end up with $this->getLayer()->getProductCollection()->clear()->addCategoryFilter($category)
for each item.
The problem is the last-displayed category filter is not being cleared before the rest of the page renders. So the sidebar layered navigation is still filtered by it. How can I clear it?? I have tried doing $this->getLayer()->getProductCollection->clear()
in _afterToHtml()
but with no luck. Any help much appreciated.