2

I have created a module to show all products with special price.

I have added layered navigation to left block. It shows proper product count. But When I click any of filter (like category, price range), it doesn't affect number of products on page.

Any suggestions would be appreciated.

3
  • 1
    Sounds like you created your own collection to display products on a page? That indeed will not work directly with the layered navigation, since your custom collection will not be adjusted by it. Though that is all speculation for now. Perhaps you can share a bit more of your code to get a better understanding of your problem.
    – Tim Hofman
    Feb 28, 2014 at 9:25
  • Yes you are right. I have created my own collection to fetch products with special price. But I am not getting any way to modify collection after applying filters from left navigation.
    – Ankita P.
    Feb 28, 2014 at 9:52
  • Thanks Tim, Actually I was using my own custom layer where I was creating collection of products with special price. Now I changed the code, I am using default layer and in my block file I added code to fetch products with special price.
    – Ankita P.
    Feb 28, 2014 at 12:04

1 Answer 1

2

As Tim said: Share some code and have a look into \Mage_Catalog_Block_Product_List::_getProductCollection especially:

$layer = $this->getLayer();
// ...
$this->_productCollection = $layer->getProductCollection();

The product collection comes from Mage_Catalog_Model_Layer which handles the filtering.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.