code help!

medusasmakeup
Excursionist
45 1 14

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 👇

<!-- 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 -->

 

Screen Shot 2024-06-05 at 7.55.59 PM.png

 

Replies 5 (5)
medusasmakeup
Excursionist
45 1 14

do I add this code to the original code?

medusasmakeup
Excursionist
45 1 14

I do not see anything

AnneLuo
Shopify Partner
612 123 126

Hi, @medusasmakeup 

I can help you with it. So I need to access your store as a collaborator if possible. 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

wo
Shopify Partner
86 22 21

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.

 

TerenceKEANE
Shopify Partner
511 86 78

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.

★ Looking for Dedicated Premium Coding Support? Join our unique "PREMIUM SUPPORT" service starting at 59 USD for 1 MONTH!
★ Get skilled Shopify developers at BUDGET-FRIENDLY RATES — explore Novajetsoft.com for a rapid quote!
If my support was a lifeline for you, The COFFEE  
would be the anchor keeping me steady!
★ For Quick response --> WhatsApp | Email --> info@novajetsoft.com | Software Engineer - Specializing In Advanced E-Commerce Websites