Shopify themes, liquid, logos, and UX
I have the IMPACT theme
I have added a % discount site-wide to all products
I want this discount % amount to also show on each product page (and on the collection page) as well as a 'was £x now £x' strike through - similar to how adding a price markdown does this, but without actually adding the markdown.
The reason I dont want to add a markdown and a discount together, is that the discount becomes applied to the newly marked down price, not the original price.
I want the discount to show relative to the original price
Has anyone found a way to do this in this theme?
Thanks!
Hello,
Please share "Store URL" and if you have any reference image so share that too.
Thanks!
site is https://nomi-home.com/
have added the 'compare at' markdown to one product as a reference for what I would like the discount to show up like (as well as applying the discount to the basket total)
minor thing but the 'save £X' red tag could also be replaced by 'save 30%' instead. not as urgent though
thanks in advance for any insight
I understand that you want to show the percentage discounted under the price. You've added it to your product-template.liquid file but you also want the discount to show up elsewhere on the store, not just when you select the product.
For the Debut theme, the place to add your code is in the product-price.liquid file, located in the Snippets folder.
Before you customize your theme:
Duplicate your theme to create a backup copy. This makes it easy to discard your changes and start again if you need to.
Add your code just above the </dl> tag, like this:
<!-- snippet/product-price.liquid -->
{% if variant.title %}
{%- assign compare_at_price = variant.compare_at_price -%}
{%- assign price = variant.price -%}
{%- assign available = variant.available -%}
{% else %}
{%- assign compare_at_price = 1999 -%}
{%- assign price = 1999 -%}
{%- assign available = true -%}
{% endif %}
{%- assign money_price = price | money -%}
<dl class="price{% if available and compare_at_price > price %} price--on-sale{% endif %}{% if available and variant.unit_price_measurement %} price--unit-available{% endif %}" data-price>
{% if section.settings.show_vendor %}
<div class="price__vendor">
<dt>
<span class="visually-hidden">{{ 'products.product.vendor' | t }}</span>
</dt>
<dd>
{{ product.vendor }}
</dd>
</div>
{% endif %}
<div class="price__regular">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.regular_price' | t }}</span>
</dt>
<dd>
{% if available %}
{% if compare_at_price > price %}
<s class="price-item price-item--regular" data-regular-price>
{{ compare_at_price | money }}
</s>
{% else %}
<span class="price-item price-item--regular" data-regular-price>
{{ money_price }}
</span>
{% endif %}
{% else %}
<span class="price-item price-item--regular" data-regular-price>
{{ 'products.product.sold_out' | t }}
</span>
{% endif %}
</dd>
</div>
<div class="price__sale">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.sale_price' | t }}</span>
</dt>
<dd>
<span class="price-item price-item--sale" data-sale-price>
{{ money_price }}
</span>
<span class="price-item__label" aria-hidden="true">{{ 'products.product.on_sale' | t }}</span>
</dd>
</div>
<div class="price__unit">
<dt>
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.unit_price_label' | t }}</span>
</dt>
<dd class="price-unit-price">
{%- capture unit_price_separator -%}
<span aria-hidden="true">/</span><span class="visually-hidden">{{ 'general.accessibility.unit_price_separator' | t }} </span>
{%- endcapture -%}
{%- capture unit_price_base_unit -%}
<span data-unit-price-base-unit>
{%- if available and variant.unit_price_measurement -%}
{%- if variant.unit_price_measurement.reference_value != 1 -%}
{{- variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ variant.unit_price_measurement.reference_unit }}
{%- endif -%}
</span>
{%- endcapture -%}
<span data-unit-price>{{ variant.unit_price | money }}</span>{{- unit_price_separator -}}{{- unit_price_base_unit -}}
</dd>
</div>
{% if product.compare_at_price_max > product.price %}Total Savings {{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0'}}%{% endif %}
</dl>
Thanks!
Does this also work the same way on the IMPACT theme?
Thanks
Hope so, Try it and see.
Hi @nomihome.
With Product Labels and Badges, you can easily create two campaigns (one for labels and one for price badges) that meet your needs by using:
1. Variable named {Discount_percentage} or {Discount_amount} (click on the three dots in the content section)
2. Discount range feature in the Product settings tab
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024