Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am looking to control the color, format, and potentially the text copy for the strike-through pricing showing on our site depending on factors such as collection or date.
Here is the liquid code for our "compare-at-details.liquid":
{% if template contains 'collection' or template contains 'index' %}
{% if on_sale %}
{% assign compare_price = product.compare_at_price %}
{% assign product_price = product.price %}
{% include 'price-sale' %}
{% endif %}
{% endif %}
{% if template contains 'product' %}
<span class="sale-tag medium">
{% if product.compare_at_price_max > product.price %}
{% assign compare_price = variant.compare_at_price %}
{% assign product_price = variant.price %}
{% include 'price-sale' %}
{% endif %}
</span>
{% endif %}
Right now, I can control where this shows up in the "compare-at.liquid" page, with something like this:
{% comment %}
----------------------------------------------------------------------------------------------------------------------------------------
[Brand] within date range
----------------------------------------------------------------------------------------------------------------------------------------
{% endcomment %}
{% elsif product.vendor == '[Brand]' %}
{% if date >= '11/14/2020' and date <= '12/12/2020' %}
{% include 'compare-at-details' %}
{% endif %}
Is there a way to change the color of the strike-through pricing and/or instead of having it say "Save XX%", change the copy to say "Save XX% - BFCM Only!" based on conditions?
Thewesternco.myshopify.com
thanks
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey 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, 2025