Show relevant tags under products.

Solved
New Member
5 0 0

I want to show relevant tags under products. (Not all)

Since some of the products looks a bit similar, I want to add the following Tags to the product.liquid: Male , female.

And if possible the brand.

I tried using the following code without luck

{% if product.tags.size > 0 %}
  <div class="product-single__tags">
    <p>
      Tags:
      {% for tag in product.tags %}
      {% assign tag_coll = '/collections/all/' | append: tag %}
        {{ tag | capitalize | link_to: tag_coll }}{% unless forloop.last %},{% endunless %}
      {% endfor %}

I also want to make them clickable similar to the screenshot and the button on this page 
This is an add-on from this question

<ul class="product-tags">
  {% for tag in product.tags %}
  <li><a href="/collections/all/{{ tag | handleize }}">{{ tag }}</a></li>
  {% endfor %}
</ul>


But did not get it as I wanted. Someone wanna help? :D

Using Brooklyn Theme. 

0 Likes
Highlighted

Success.

Shopify Partner
1870 312 400

Hi @Ikke-69 

Try this:

This will show link if tag is Male or female

 

{% for tag in product.tags %}
{% if tag contains 'Male' or tag contains 'female' %}
	<li>{{ tag | link_to_tag: tag }}</li>
{% endif %}
{% endfor %}

Change your tag with Male or female

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
1 Like