Out of stock products are visible in my magento website. I want a custom filter in the layered navigation which would say "Exclude out of stock" and when customer clicks on it the out of stock products should be hidden.
(by default I enable showing/displaying out of stock products under System-> Configuration-> CATALOG-> Inventory)
i.e. I want the customer to control whether he/she should see the "out of stock" products or not.
example this link
can anyone help please? I want this to be done in magento way...
this is the development work. you need to hire some one.
basically you need to create attribute for product.
eg. 'exclude_out_of_stock'.
then you need to code in Mage/Catalog/Block/Product/List.php
modify
function _getProductCollection()
FROM
$this->_productCollection = $layer->getProductCollection();
TO