Shopify themes, liquid, logos, and UX
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
snippets > card.product.liquid
UNDER THIS line 266 (approximate line)
{% render 'price', product: card_product, price_class: '' %}
Copy below 👇
<!-- Start of the sale announcement -->
<p class="sale-announcement" style="color: red; font-size: 12px;">20% OFF W/ CODE FUN20</p>
<!-- End of the sale announcement -->
do I add this code to the original code?
I do not see anything
Hi, @medusasmakeup
I can help you with it. So I need to access your store as a collaborator if possible.
I prefer to do it this way.
{% render 'price', product: card_product, price_class: '' %}
{% if section.settings.sale_announcement != blank %}
<p class="sale-announcement" style="color: red; font-size: 12px;">{{ section.settings.sale_announcement }}</p>
{% 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.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025