Add Text line to any product that has a specific tag

Topic summary

Goal: Show a dynamic line of text on product pages based on product tags in Shopify.

Solution provided: Use Shopify’s Liquid (templating language) to read product.tags and conditionally render text. Example approach: assign productTags = product.tags joined into a string, then use contains checks to output different messages for tags like “Bisque,” “Cast,” or “WOW.”

Outcome: Original poster confirmed the code works. A reminder was given to mark the solution.

Follow-up requests (unanswered):

  • Add a line in Studio theme when tag “exhibiting” is present, including a contact link in the message.
  • Scale the logic to ~50 specific tags, each mapping to unique link text and destination, and guidance on where to place the code.

Notes:

  • This relies on Liquid conditionals with product.tags. You can add the logic in the product template (e.g., main-product.liquid/section) or a snippet included on product pages, ensuring it renders within the product description area if desired.

Status: Original question resolved; expansion requests for link insertion, large tag-to-link mapping, and placement details remain open.

Summarized with AI on December 31. AI used: gpt-5.

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

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!

Works perfectly.

Thank you.

Barry

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

1 Like

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.

Hi there,

I came upon this solution and wanted to see if it could be taken a step further:

I’d like to define logic that adds a hyperlink into the descriptions of any products tagged with one of 50 specific tags. The link text/destination is different for each of those 50 tags.

Is it possible to use that same logic {% if productTags contains “Your_Tag” %} and add something to the effect of

% then add visible link text %

?

And then add a line for each of those 50 tags and its associated link destination/text.

And if the above is possible…where exactly would I add this code?

Many thanks in advance!
Noah