Need help with simple code

Solved
New Member
3 0 0

So I've removed the tag 'Women' from the filter selector, what do i add to the code to block multiple tags?

 

 

{% for tag in collection.all_tags %}

          {% unless tag contains 'Women' %}

           <option value="/collections/{% if collection.handle != blank %}{{ collection.handle }}{% else %}all{% endif %}/{{                  tag | handleize }}"{% if current_tags contains tag %} selected="selected"{% endif %}>{{ tag }}</option>
{% endunless %}

0 Likes

Success.

Shopify Partner
519 106 142

@EmilRothmann 

 

You can use "or" operator in "unless" condition. like following code:

{% for tag in collection.all_tags %}
          {% unless tag contains 'Women' or tag contains 'Men' or tag contains 'XYZ' %}
           <option value="/collections/{% if collection.handle != blank %}{{ collection.handle }}{% else %}all{% endif %}/{{                  tag | handleize }}"{% if current_tags contains tag %} selected="selected"{% endif %}>{{ tag }}</option>
          {% endunless %}
{% endfor %}

Cheers,

Tejas

 

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
0 Likes
Highlighted
New Member
3 0 0

It worked, thank you so much

0 Likes