In product listing page I need to rearrange product listing price.

$_productCollection = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSort('price', 'ASC')

I tried above code in list.phtml page it's working in initial list.

Not working in ajax scroll

  • 1
    Well, I'm guessing your ajax call calls a controller, did you change it in your controller too? Commented Mar 29, 2016 at 11:38
  • You want add price filter ??
    – Arunendra
    Commented Mar 29, 2016 at 11:42
  • @Arunendra yes i need price sorting Commented Mar 29, 2016 at 11:50
  • @JulienLachal I don't know where i need to change controller Commented Mar 29, 2016 at 11:51

1 Answer 1


You need to override _getProductCollection() function.

Or copy List.php from core location


And paste in local codePool


And add your new filter just before this line


your code will be like:

$this->_productCollection = $layer->getProductCollection()->addFieldToFilter('price','ASC');  

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.