I need some help with the following issue. I use an attribute in the layered navigation which is connected to stock values. The attribute has two options - In stock and All products (which includes out of stock products as well).

Is there any way I can have the In stock option selected by default when an user enters a category page? This way users would view only products which are in stock, but if they want they can select all products and also view the others.

  • navigation filter works after load a category page... We need to manually select options in navigation filter to filter category products. – Rajeev K Tomy Aug 12 '14 at 14:12
  • Have you found a solution? – Amasty Aug 15 '14 at 23:03
  • Did you find a working solution? – snh_nl Feb 10 '15 at 12:42

You need to update catalog/layer/filer/atribute.php model , method apply in the following way:

0) check the attribute code, if the code is our filter, continue

1) if the url is empty, we assume in stock is selected

2) you also need custom logic for the link "clear" and "clear all" in the catalog/layer/filer/item.php model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.