Shopify filters show sold-out variants

Hi, I am experiencing an issue with the filter search, because if I select only size 37 via filter it also shows me footwear where size 37 is out of stock, while I would like it to show only footwear where the size is available. Is there any possibility to solve this issue?
Thankss

@sarah2101 Try adding the following in main-search.liquid right after input with class “search__input field__input”:

<input type="hidden" name="options[unavailable_products]" value="hide" />

More info on this implementation can be found here.

Hi @kjchabra , thank you very much for answering, but pity I don’t have the class you say, where do I insert the code?

{%- render 'breadcrumbs' -%}

{{ 'general.search.title' | t }}

{%- render ‘search-bar’, search_btn_style: ‘btn’, search_bar_location: ‘search-bar–page’ -%}

{%- if search.performed -%}


{%- if search.results_count == 0 -%}

{{ 'general.search.no_results_html' | t: terms: search.terms | replace: '*', '' }}

{%- endif -%}

{%- if search.results_count != 0 -%}

{%- assign paginate_by = section.settings.per_row | times: section.settings.rows_per_page -%}
{%- paginate search.results by paginate_by -%}

{%- render 'collection-grid-filters', collection: search, enable_sidebar: section.settings.enable_sidebar, filter_style: section.settings.filter_style, collapsed: section.settings.collapsed, enable_color_swatches: section.settings.enable_color_swatches -%}
{% render 'collection-grid', collection: search, items: search.results, enable_sidebar: section.settings.enable_sidebar, filter_style: section.settings.filter_style, enable_sort: true, enable_collection_count: true, per_row: section.settings.per_row, mobile_flush_grid: section.settings.mobile_flush_grid quick_shop_enable: settings.quick_shop_enable %}

{%- if paginate.pages > 1 -%}
{%- render ‘pagination’, paginate: paginate -%}
{%- endif -%}