B-219 Sec-55 Noida, India

How to show out of stock products to the end of the product list in Magento

First of all overwrite the file


and copy this file to


In function getProductCollection(), Put this code after line #102

$collection->joinField(‘inventory_in_stock’, ‘cataloginventory_stock_item’, ‘is_in_stock’, ‘product_id=entity_id’,’is_in_stock>=0′, ‘left’)->setOrder(‘inventory_in_stock’, ‘desc’);

(Visited 66 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.