All things Shopify and commerce
Hello, as you can see from the screenshots above that I can edit what is shown for products on sale. My question is, what should I enter instead of "33" for the site to calculate the discounted value as I am not willing to make each product on 33% sale.
Solved! Go to the solution
This is an accepted solution.
Hi @-ATT-
Dan here from Ryviu: Product Reviews & QA app.
Please visit your Online Store > Themes > Edit code > open price.liquid file, find this line of code
{{ 'products.product.on_sale' | t }}
Replace it with this.
{%- assign percent = product.compare_at_price | minus:product.price | times: 100 | divided_by:product.compare_at_price | round -%}
{{ percent }}% SALE
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hello @-ATT-
You can watch this video to set discount
https://www.youtube.com/watch?v=di2O_H1KRdY&t=25s
Hello @-ATT-
You need to add this liquid code if it is not available on your product page
{% if product.compare_at_price > product.price %}
{% assign discount_percentage = product.compare_at_price | minus: product.price%}
{% assign discount_percentage = discount_percentage | times: 100 %}
{% assign discount_percentage = discount_percentage | divided_by: product.compare_at_price %}
<p>{{ discount_percentage }}% off</p>
{% endif %}
See the above image. I tried and it works well. You may need to apply CSS based on your requirement.
This is an accepted solution.
Hi @-ATT-
Dan here from Ryviu: Product Reviews & QA app.
Please visit your Online Store > Themes > Edit code > open price.liquid file, find this line of code
{{ 'products.product.on_sale' | t }}
Replace it with this.
{%- assign percent = product.compare_at_price | minus:product.price | times: 100 | divided_by:product.compare_at_price | round -%}
{{ percent }}% SALE
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Thank you so much! Things from older forums have changed so much that I could get none to work, but this did it!
Hey, Dan! I've tried your suggested method on my store yuneeq.in and thank you, it is working perfectly.
I've just changed the SALE to OFF and it is live now.
Have a great day ahead.
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover 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, 2025