0

I am using Magento 1.9 , to display out of stock products at the end of product list i have replaced the code

<?php
    $this->_productCollection = $layer->getProductCollection();
?>

With

<?php
    $this->_productCollection = $layer->getProductCollection()->joinField('inventory_in_stock', 'cataloginventory_stock_item', 'is_in_stock', 'product_id=entity_id','is_in_stock>=0', 'left')->setOrder('inventory_in_stock','desc');
?>

in app/code/core/Mage/catelog/Block/product/list.php now products sorting for position and name the out of stock products are last. But when sorting for price, the out of stock products are in a normal order not last.

How can i make that the out of stock products to be last even in the sort after price ?Please help me find out this solution.

1 Answer 1

0

You can use solution 2 of this answer. it worked for me:

of this solution. it worked for me: https://magento.stackexchange.com/a/32950

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.