0

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.

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

1 Answer 1

1

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 and acknowledge you have read our privacy policy.

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