I had Overridden the product List.php Class & here is the code
protected function _getProductCollection()
{
if (is_null($this->_productCollection)) {
$result = array_unique($productIds);
$collection = Mage::getResourceModel('catalog/product_collection');
$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$collection->addAttributeToSelect($attributes);
$collection->addIdFilter($result);
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
$this->_productCollection = $collection;
}
return $this->_productCollection;
}
working fine, I also had added Layered Navigation as mentioned here and layered navigation appeared as expected.
The only problem is, when I click on any filter in layered navigation, navigation gets updated and filter also get added to url, but product list won't get filtered by the selected filter. Please guide me how can I apply the filters on product collection
I could be wrong here, but your overridden
_getProductCollection()
method seems to be bypassing the layered navigation. I don’t know what your goal was that required you to do that, but the original version gets the product collection injected from the layered navigation modelMage_Catalog_Model_Layer
:Perhaps you should revert to the original version of this method and see if layered navigation starts working, and if so then you know that you need to extend or incorporate this layer logic into your version.