Hide 0 stock Variants from Filters (Search&Discovery)

Topic summary

A solution has been shared for hiding out-of-stock variants from filter results when using the Dawn theme and Search & Discovery app.

Implementation details:

  • Requires modifying the facet.js file to display only available variants
  • The modified code file was attached to the post
  • Users should copy/paste the code into Shopify’s code editor
  • Recommended to test on a theme copy first

Additional requirement:

  • The “Availability” filter type must be activated for the solution to work

The poster reports the solution works smoothly in their implementation.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hi everyone,

i find a solution when you have out of stock variants and you want to hide them from filters results.

I use Dawn theme and Search&Discovery app.

I adapted a bit the facet.js file to only show available variants. Here attached the file, just open it with text editor… then copy/paste the code in code editor on shopify (test with a copy of your theme)

It works smoothly :slightly_smiling_face:

Bye

Julien

Also you need to activate the filter type “Availability”