-1

In the config I have set "show out of stock products" to YES

but want to give the option to the visitor to hide "out of stock" products if wished on the category listing page as part of the layered navigation option

or filter on instock products

Any thoughts ??

migs
  • 1

1 Answers1

0

Mage a customer attribute ( boolean - yes/no ) ( example : show_outofstock ) and make default ( no ) and Make custom Module to extend this helper :

app/code/core/Mage/CatalogInventory/Helper/Data.php

Mage_CatalogInventory_Helper_Data

and rewrite the method

public function isShowOutOfStock()
{

    $customer = Mage::helper('customer')->getCustomer();
    if($customer )
    {
        return $customer->getShowOutofstock();
    }
    //return Mage::getStoreConfigFlag(self::XML_PATH_SHOW_OUT_OF_STOCK);
}
Meabed
  • 3,828
  • 1
  • 27
  • 37