How to add custom message using tags on collection page in spotlight theme?

How to add custom message using tags on collection page in spotlight theme?

mzwa
Visitor
2 0 0

Hi! I want to use product tags to display custom messages on 'Collection pages under the products on Spotlight theme. I have already done this on Product page but am struggling to add the same message to the collection pages. Please help

Replies 3 (3)

Dan-From-Ryviu
Shopify Partner
10957 2148 2287

Hi @mzwa 

Dan here from Ryviu: Product Reviews @& QA app.

 

You can use this code in your card-product.liquid file

{% if card_product.tags contains 'your tag'  %}
your message
{% endif %}

 

- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

mzwa
Visitor
2 0 0

Unfortunately no changes with the code you gave. I used the following code on the main-product.liquid for the message on the product page which worked successfully.

 

{% for tag in product.tags %} 

 {% if tag contains 'newMessage:' %} 

<span class="message-card_product">

                {{ tag | remove:'newMessage:'}} 

  </span>

         {% endif %}

{% endfor %}

 

When I put this in the card-product.liquid file I don't see the message it in the collection page. I do see a message in the product page on the related products (the same message displayed under the product page on that particular product page ). This message under the related products doesn't apply to that particular product. Please help

Dan-From-Ryviu
Shopify Partner
10957 2148 2287

You can try to edit this 

{% for tag in card_product.tags %} 
 {% if tag contains 'newMessage:' %} 
  <span class="message-card_product">
    {{ tag | remove:'newMessage:'}} 
  </span>
  {% endif %}
{% endfor %}

- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.