Solved

Add Text line to any product that has a specific tag.

TheFunkyTeapot
Tourist
7 0 1

Hi, all you clever people. I am sure this is an easy few lines of code! I know I could do what I want by adding this to each and every product description text, but I think a few lines of code will do it universally and quicker?

Is there a variable that can be used to check the "Tags" of a product? Something like?

{% if current_variant.inventory_TAG == "Bisque" %}
Please Note: - This item will need to be returned and fired
{% if current_variant.inventory_TAG == "Cast" %}

This item will require a 45 minute appointment. Please call to book

{%Else %}

Add Nothing
{% endif %}

So I want to add a line of text to all products, but changes depending if the product has a specific Tag.

If Product Tag list includes "Bisque" then show " Please Note: - This item will need to be returned and fired"

If Product Tag list includes "Cast" then show "This item will require a 45 minute appointment. Please call to book"

If Product Tag list include "WOW" then show "This item can be completed without visiting us"

etc

Hope that makes sense,

Thanks Barry

 

 

Accepted Solution (1)
JHKCreate
Shopify Expert
3571 639 916

This is an accepted solution.

Fantastic! Don't forget to Mark As Solution & Like to make the answer more visible to the community, Cheers!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com

View solution in original post

Replies 4 (4)

JHKCreate
Shopify Expert
3571 639 916

Hi @TheFunkyTeapot ,

This is the code for the tag logic:

{% assign productTags = product.tags | join:',' %}

{% if productTags contains "Your_Tag" %}

{%endif%}

 

Let me know if that works for you!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
TheFunkyTeapot
Tourist
7 0 1

Works perfectly.

Thank you.

Barry

JHKCreate
Shopify Expert
3571 639 916

This is an accepted solution.

Fantastic! Don't forget to Mark As Solution & Like to make the answer more visible to the community, Cheers!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
candrewsart
New Member
9 0 0

Could you expand on this solution? I'm looking to do the same thing; add a line of text in the product description "This work is currently on exhibit, please contact me for purchase 'link to contact form'" when an artwork in my shop has the tag 'exhibiting'. I have the Studio theme.