I want to hide out of stock products from showing in search or category pages and I do not want to use the built in feature:
Admin >> System >> Configuration >> Catalog >> Inventory >> Stock Options
Display Out of Stock product -> No
The reason is that I use and sort out of stock products and if I disable them completely I can't filter by Stock status.
How do I put a filter on the category and search collection?
Best Answer
I have done it and I know it will help a lot of people so this is what I did to achieve this:
Firstly you need to modify the collection which is loaded in:
You're best making a local copy and editing that:
Find this line:
Directly under it place this code:
I hope this helps :)