How To Show Discount percent On website using Origin Theme

Hello, how can you show discount percent on the website (I’m using the Origin theme)

1 Like

@Gossipladyz

You can do it very easily if you can modify the liquid files.
Just login in your shopify admin store. There you will see the option of online store.
Expand it here you will find the menu Theme.
Then from there you can find the option to edit the code and find “product-price.liquid” file.
In that files you can write the code after line number 12 write the below code
{% if compare_at_price %}
{% capture discount %}
{{ compare_at_price | minus:price | times:100 | divided_by:compare_at_price }}%
{% endcapture %}
{{ discount }}
{% endif %}

here {{ discount }} is you % discount you can use at any place in that liquid file.

Please let me know if it was helpful.

Thanks!

After updating the given code its not working

@Gossipladyz

Add liquid code to your snippets/price.liquid file.

The update was done on snippets/price.liquid file only

@Gossipladyz

code is working or not

no its not working

@Gossipladyz

This is code customization work Please hire a Shopify expert he can help you!

Thanks!