DISCOUNT IN PERCENTAGE

Tourist
3 0 1

Hello Shopify,

I need help with how to create a% discount on a product. Example: In the product I put the price before 70USD now 50 USD, there was only the inscription SALE.

If I put this code there, it will show me exactly what I added in the attachment -photo (confusing and bad in appearance)

Online Store->Theme->Edit code
Asset->snippets/product-price-listing.liquid-> paste bellow code after price

{% 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 product.compare_at_price_max > product.price %} ({{ product.compare_at_price | minus: product.price | money }}){% endif %}

Thank you for help.

Bez názvu.png

 

0 Likes