guys so recently I noticed that when I select a filter, for example, the size M some of the products even though they have the size M some of them are out of stock and I was wondering if it's possible to overwrite the search function or add new functionality so it doesn't display products that don't have stock in size M for example.

To better explain my problem:

  • User selects filter of size M;
  • Products with size M in stock and out of stock are displayed

What I would like to know is if it's possible to only display products where the filter in the example M is in stock.

I read some posts but all of them are some hacky unstable modifications and I would like to avoid that as much as possible since this is intended to go into production.

1 Answer 1


I think this link is having the answer of your question https://magento.stackexchange.com/a/154654/95067 Please try it sir.

From admin panel

It can manage from admin panel follow the following steps

login admin

go to "system"--> "Configuration"

in that goto left side navigation bar "Catalog"--->"Inventory"

then goto right side tabs there is 2 tabs in that click on "Stock Options"

in that tab change "yes" for "Display Out of Stock Products" Option

  • That answer is a hack to the current way its indexing which I would like to avoid
    – DeadSec
    Jul 28, 2021 at 15:54

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.