How can I display sale percentage in Dawn theme's sale badge?

How can I display sale percentage in Dawn theme's sale badge?

DaandeLeur
Excursionist
29 0 9

I want the percentage to be shawn instead of text for the sales badge next to the price

Replies 2 (2)

Made4uo-Ribe
Shopify Partner
10048 2390 3017

Hi @DaandeLeur 

Go to Online Store > Clic the 3dots > Edit default theme Content > 

Made4uoRibe_0-1724702962924.png

When you enter choose Products.

Made4uoRibe_1-1724702986203.png

And Find the on Sale. 

Made4uoRibe_2-1724703014562.png

Change and Save. 

Result:

Made4uoRibe_3-1724703037250.png

 

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

gr_trading
Shopify Partner
2045 149 206

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...

For any custom development WhatsApp or connect at Email ID: support@grtrading.in for quick consultation. | Shopify Free codes
To support Buy Me a Coffee