1

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',
                         'cataloginventory/stock_item',
                         'is_in_stock',
                         'product_id=entity_id',
                         '{{table}}.stock_id=1',
                         '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

$this->getCollection()

Thanks

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

1 Answer 1

0

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

$this->getToolbarBlock()->setTemplate('catalog/product/list/toolbar_bottom.phtml')->setCollection($_productCollection)->toHtml();

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.