Shopify themes, liquid, logos, and UX
I want the percentage to be shawn instead of text for the sales badge next to the price
Hi @DaandeLeur
Go to Online Store > Clic the 3dots > Edit default theme Content >
When you enter choose Products.
And Find the on Sale.
Change and Save.
Result:
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Hi @DaandeLeur ,
Please refer to the code below to implement it in the card-product.liquid file. The file name may vary depending on the theme, but for reference, we're using the DAWN theme here.
{%- assign difference = card_product.compare_at_price | minus: card_product.price -%}
{%- assign float_difference = difference | times: 1.0 -%}
{%- assign discount_fraction = float_difference | divided_by: card_product.compare_at_price -%}
{%- assign discount_percentage = discount_fraction | times: 100 | round -%}
{{- discount_percentage }}
For detailed implementation kindly refer the below video to implement the same.
Hope this will helps...
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025