Hiding price on collection page for products of certain tag/category

Solved
New Member
3 0 0

I'm sorry but I could not find a working solution here on the forums.

Can someone please let me know how to modify the collections code that product prices are not shown on the collection page when a product is associated with a certain tag or category?

Thanks a lot

0 Likes
Shopify Partner
1202 246 322

This is an accepted solution.

Hello

 

{% assign has_tag = false %}
{% for tag in product.tags %}
  {% if tag contains "your-tag:" %}
    {% assign has_tag = true %}
  {% endif %}
{% endfor %}  

{% if has_tag  == true %}
// Show price
{% else %}
// don't show price
{% endif %}
Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate Click here (Its my paypal)
New Member
3 0 0

which template / snippet is this in?

0 Likes
New Member
2 0 0

bump

0 Likes
New Member
2 0 0

Which template, snippet, or line of HTML should this be inserted? 

0 Likes
Shopify Partner
1202 246 322

This code doesn't belong to any specific file.
This code is  just a logic which you can use with the existing code.

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate Click here (Its my paypal)
0 Likes
New Member
2 0 0
where is the existing code?
0 Likes