I am using the following code to display a line of text under the product price on the collection page. This text is under every product. Is there a way to exclude a specific collection from this code? I have also attached a screenshot of what it looks like for reference.
Sense theme
www.medusasmakeup.com
snippets > card.product.liquid
UNDER THIS line 266 (approximate line)
{% render ‘price’, product: card_product, price_class: ‘’ %}
Copy below
20% OFF W/ CODE FUN20
Hi, @medusasmakeup
I can help you with it. So I need to access your store as a collaborator if possible.
do I add this code to the original code?
wo
June 6, 2024, 5:34am
5
I prefer to do it this way.
{% render 'price', product: card_product, price_class: '' %}
{% if section.settings.sale_announcement != blank %}
{{ section.settings.sale_announcement }}
{% endif %}
{% schema %}
****
{
"type": "text",
"id": "sale_announcement",
"label": "Sale Announcement",
"default": "20% OFF W/ CODE FUN20"
}
****
{% endschema %}
Then create a collection template in the theme customization, and select this collection template if needs this text.
Hi,
It can be done with JavaScript. If you tell me which collection page you want to hide this area on, I can assist you.
Terence.