I have tried to filter the magento product result according to stock and all color and etc. so i have wrote some query, but instead of query my pagination page numbers are different, when i debug this then i got that my pagination 'pager.phtml' file load any other collection from any where but not loading my custom filter collection so how i can load my custom collection in pager.html file..

$_productCollection = $_productCollection->joinField('is_in_stock',
                         'left')->addAttributeToSort('updated_at','desc')->addAttributeToFilter('is_in_stock', array('gt' => 0));

abover query return 134 results but below file query retrieving 230 results /app/design/frontend/default/MAG090181/template/catalog/product/list/toolbar.phtml



  • can you please share your code and file location?
    – Abdul
    Nov 18 '15 at 7:17
  • @Abdul ,yeah sure .. Nov 18 '15 at 7:21
  • Please add your code in function prepareProductCollection() at location Mage_Catalog_Model_Layer
    – Abdul
    Nov 18 '15 at 7:39

Thanks @Abdul . But i have found another and good way by which i did that, below is the code


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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