how to show % of discount

Anonymous
Not applicable
1632 0 0

Hello! I would like to add the % discount next to price. Can anybody help me please?

 

Schermata 2021-01-25 alle 10.38.26.png

0 Likes
Bluish
Shopify Partner
555 78 88

Hi @Anonymous 

Try the below code, put it in your collection.liquid file where the pricing section is.

{% if product.compare_at_price_max > product.price %}You save {{ 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 %}

 

If my answer was helpful please Like and Accept my post as the Solution
0 Likes
Anonymous
Not applicable
1632 0 0

where I can find price section?

0 Likes
Bluish
Shopify Partner
555 78 88

Hi @Anonymous 

I suggest you find a developer to implement this.

If my answer was helpful please Like and Accept my post as the Solution
0 Likes