Impulse Theme: Size filter shows out-of-stock sizes and unavailable variants

Hi everyone,

I am using the Impulse theme alongside the Shopify Search & Discovery app.

Currently, when a customer filters my collection pages by a specific size, the results still show products where that filtered size is completely out of stock. It seems the filter is pulling products based on any variant being in stock, rather than hiding the specific variants that have zero inventory.

I am not comfortable making theme code edits myself.

Is there a built-in settings fix for the Impulse theme to resolve this, or a known workaround using the Search & Discovery app? If code is required, could someone point me toward exactly what needs to be changed so I can hire a partner or developer to apply it safely?

Thank you for your help!

Hey @Kralc_Bocaj

That’s how usually Shopify filters works by default regardless of any theme. I have noticed this myself in a couple of themes as well.

Usually people have two ways to sort this out, either they get a completely separate third party filters app (which I don’t recommend because filters app are really messy) OR They just get their filters modified within the theme code since they’re a part of theme.

Regarding your theme, which is Impulse. For sure it can be fixed and without having a look at the backend, I can’t point you to the right direction so if you’d like me to help then feel free to let me know and I’ll be happy to sort it out.

Cheers,
Moeed

This isn’t an Impulse bug or a setting you missed. Impulse and the Search & Discovery app both run on Shopify’s native storefront filtering, which has a hard limit here:

  • A size filter matches any product that HAS that size, regardless of whether that size is in stock.
  • The only stock-aware filter, “Availability,” is product-level (a product counts as in stock if any one variant is in stock), so “Medium” + “In stock” still can’t mean “Medium is in stock.”
    No theme setting or Search & Discovery toggle changes this.

Two options:

  1. Variant-level filter app (reliable). Boost AI Search & Filter or Globo Smart Product Filter can index at the variant level. Look for “show variants as separate products” or “hide out-of-stock variants.” This is the only route that keeps your product counts and pagination correct.

  2. Theme code : i am working on it. Will soon post

Technically, all themes from the theme store are required to utilize the Shopify own filtering engine which is controlled by the “Search & Discovery” app.

The engine does consider variants when performing filtering.

Say you can have a product with one variant available and another sold – you can check both “Available” and “Unavailable” checkboxes and this product will show.
Which is kinda counter-intuitive, but…

This is the engine feature and not something you can easily change in theme settings or code, no matter what theme you’re using.

If it’s a deal breaker, the only option usually is to move to using one of the search and filter app as already mentioned. It has its own drawbacks.

@Kralc_Bocaj Here is the code as promised:

Add it inside the product loop in sections/collection-template.liquid. Right before the card renders.

It reads the active size from the filter. Then skips any product with no available variant in that size.

{%- assign size_option_name = 'Size' -%}
{%- assign size_param = 'filter.v.option.' | append: size_option_name | handleize -%}

{%- assign active_sizes = '' -%}
{%- for f in collection.filters -%}
  {%- if f.param_name == size_param -%}
    {%- for v in f.active_values -%}
      {%- assign active_sizes = active_sizes | append: '|' | append: v.value | append: '|' -%}
    {%- endfor -%}
  {%- endif -%}
{%- endfor -%}

{%- if active_sizes != '' -%}
  {%- assign size_pos = 0 -%}
  {%- for opt in product.options_with_values -%}
    {%- if opt.name == size_option_name -%}{%- assign size_pos = opt.position -%}{%- endif -%}
  {%- endfor -%}

  {%- if size_pos > 0 -%}
    {%- assign match_in_stock = false -%}
    {%- for v in product.variants -%}
      {%- if v.available -%}
        {%- assign vsize = '' -%}
        {%- if size_pos == 1 -%}{%- assign vsize = v.option1 -%}
        {%- elsif size_pos == 2 -%}{%- assign vsize = v.option2 -%}
        {%- elsif size_pos == 3 -%}{%- assign vsize = v.option3 -%}{%- endif -%}
        {%- assign needle = '|' | append: vsize | append: '|' -%}
        {%- if active_sizes contains needle -%}{%- assign match_in_stock = true -%}{%- endif -%}
      {%- endif -%}
    {%- endfor -%}

    {%- unless match_in_stock -%}{%- continue -%}{%- endunless -%}
  {%- endif -%}
{%- endif -%}

Note: No app needed. But the “N products” count won’t update. Pagination won’t either. Only the cards hide.

Note: The code is only for size filter. For other filters, you can extend it. If you want that, just ask here.

Tested this on a live store:

  1. I installed the search and discovery app from shopify.
  2. Tested on Dawn Theme. Your theme is paid one. And It seems I cannot edit the code on the trial plan. But the concept is the same.
  3. Confirmed it hides the sold-out-size product. Confirmed it doesn’t hide products that still have that size in stock.
    Buggy one - without this fix applied:

    After applying the fix - SEE THE THIRD ONE IS OUT OF THE LIST:

If it solves your problem, mark it as solution

Regards,
Ajay from Pinflow