Liquid, JavaScript, themes, sales channels
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
User | RANK |
---|---|
38 | |
29 | |
13 | |
12 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023