Omit search results by product tag eg: wholesale

Hi,

I’m using this code to hide wholesale products from search results in the Minimal theme. I’m now trying to set up the Dawn theme but I do not know where to put it.

I’d really appreciate any help. Thank you!

{% for item in search.results %}
{% unless item.tags contains ‘wholesale’ %}

{% endunless %}
{% endfor %}

Hi @Smeelah Please avoid pasting the entire contents of files, only paste the relevant bits or link to the file when the theme is open source https://github.com/Shopify/dawn .

Expecting others to read hundreds of lines of irrelevant code to solve your problem is a discourtesy.

At minimum as a courtesy use the code formatting button in the post editor.

Same as you did last time wrap the interior output after the opening for tag loop

{%- for item in search.results -%}
    {% unless item.tags contains 'wholesale' %}
        - ....
          ....
          {%- endcase -%}
        

{% endunless %}
{%- endfor -%}

@PaulNewton No discourtesy intended. Thanks for the info. Sorry to upset.

Of course , I just want to increase your future chances and the chances of any other readers in the future in getting help; as things like walls-of-text can massively decrease the chance others even read a question let alone lend aid in troubleshooting.

Which can be unfortunate to not get help when you issue like the one here that’s seems straightforward and solvable.

https://community.shopify.com/c/blog/how-to-get-support-from-the-community/ba-p/1399408

Goodluck!

@PaulNewton That’s so kind of you. Thank you.