Goal: Show a promo line under product prices on collection pages (Sense theme) but exclude certain collections.
Context: The code was added in snippets/card.product.liquid directly under {% render ‘price’, product: card_product, price_class: ‘’ %}, inserting a static
20% OFF W/ CODE FUN20
. A screenshot was shared; the code snippet is central to understanding.
Proposed solutions:
Liquid setting + template approach: Wrap the promo in a conditional that outputs section.settings.sale_announcement, add a schema text setting, then create an alternate collection template. Assign this template only to collections that should display the announcement, leaving excluded collections on the default template. (A “collection template” is an alternate theme template you can assign per collection; the schema creates a theme setting.)
JavaScript approach: Hide the promo on specified collection pages if given the collection handle/URL.
Clarifications needed: The OP asked whether to merge the new code with the original and later noted they didn’t see any output.
Status: No confirmed resolution. Next steps: implement the conditional Liquid/template method or provide the target collection for a JS-based hide.
Summarized with AI on December 27.
AI used: gpt-5.
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.