Limit tags which show up in tag filters in Debut theme

Highlighted
Shopify Partner
7 0 0

Hi all,

 

Using a Debut theme for one of our stores and it has a cool built-in tag filtering feature.

 

We would like to use the feature but we use some product tags for internal purposes and our customers should not see them.

 

I am looking for suggestions to set up the theme that it ignores some tags by their syntax or other means.

 

Example (totally made up but indicative):

Product: Red Cotton Shirt

Public tags: Red,Cotton,Shirt

Private Tags: INTFactory#,INTMadeInCountry, etc

 

I would be happy if internal tags didn't show because they start with "INT" or whatever else.

 

Thank you all in advance

0 Likes
Shopify Partner
551 108 130

Hello 

 

You can use condition to ignore tags which you don't want like this

{% if tag == 'Tag-name' or tag == 'tag-name'  %}
// leave blank
{% else %}
// Your others tags will be hear
{% endif %}

Thanks

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
Shopify Partner
7 0 0
Thank you so much. Is it possible to modify this to accept wildcards?

Something like

{% if tag == 'tag-begins-with-Internal' or tag == 'tag-name' %} // leave
blank {% else %} // Your others tags will be hear {% endif %}

That way we wouldn't need to update this code every time we add another tag
0 Likes
Highlighted
Shopify Partner
551 108 130

Yes, but you have to write code for this. 

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted

Hey MZ3,

 

This seem to be the script you are looking for. 

{% if product.tags contains "Hello" %}
  This product has been tagged with "Hello".
{% endif %}

Here is a link with some more references.

https://shopify.github.io/liquid/basics/operators/

 

Let me know if this helps.

LMPTechSolutions.com

0 Likes