(need help) Text to be displayed for specific products using tags

Topic summary

A user working with Shopify’s Dawn theme (version 8) needed help displaying custom text (“Myymälätuote”) only on products tagged “myymalatuote” within collection grids. These are in-store-only showcase products with disabled cart functionality.

The Problem:

  • Custom text appeared on ALL products instead of only tagged ones
  • Code was added to card-product.liquid
  • Initial loop structure incorrectly referenced product.tags for all products in collection

The Solution:
Another user provided corrected code that uses card_product.tags instead of product.tags within the forloop, properly targeting only tagged products.

Outcome:
The fix worked successfully. The custom Finnish text now displays only on appropriately tagged products as intended.

Summarized with AI on November 20. AI used: claude-sonnet-4-5-20250929.

Hello! Seeking for some coding(?) help.. I am using Dawn theme version 8. (the one which came just before 9).

The site has products which are only available in the local store and are only for showcasing. That for I’ve made a template and applied it for those products and their product pages (disabled add to cart options etc.).

I then ran into trouble when I wanted to add a custom text to those products in the collection grid.

It is in finnish and it is supposed to say “Myymälätuote” on top of the tagged products.

The tag I am using right now is “myymalatuote”.

To the problem itself.
The text appears in the right place but it is applied to all products instead of the ones that it is supposed to.

I have been applying the code into: card-product.liquid and here is the code I’ve tried to get working.

{% for product in products %}
{% if product.tags contains ‘myymalatuote’ %}
Myymälätuote
{% endif %}
{% endfor %}

Here is an image of the page and how the texts appear:

Text on all of the products

And here is an image of the code in card-product.liquid:

The code

Edit:

Here is also image showing that I’ve tagged Testituote (test product):

Tagged

tldr: need the “Myymälätuote” text only applied to the products tagged as “myymalatuote” instead of all of them.

Tried changing product / products to collection etc. didn’t work. Just did the same thing (shows up on all of the products).

Help appreciated!

1 Like

Hi @doozmyy

Try the code below instead and replace your existing forloop code.

{% if card_product.tags contains 'myymalatuote' %}
Myymälätuote
{% endif %}
1 Like

Were you able to get it solved yet?

Thank you a thousand! So simple and it works.

Have a nice day man. Thanks once again!