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
7538 1454 1452

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 %}

 

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- 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
7538 1454 1452

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 %}

- Helpful? Like or Accept solution! - Buy me a coffee
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look
- Enjoy 1 month of Shopify for $1. Sign up now