Hello,
I would like to add discount percentages and numbers on the product page.
Any suggestions on how to do this would be appreciated.
Thank you
Here’s my web: www.vedec.in
Hello,
I would like to add discount percentages and numbers on the product page.
Any suggestions on how to do this would be appreciated.
Thank you
Here’s my web: www.vedec.in
Hi Arohan, is this a markdown you’ve applied using the “compare at price”? Or an automatic discount?
It looks like “compare at price,” so most likely, you’ll need to edit your “price.liquid” file (or whatever product prices are called in your theme), and dynamically calculate the discount percentage using Liquid filters.
That doesn’t really seem like what they’re asking for, based on the screenshot in their original post.
As shown, the price of the product on the PDP is already discounted, without a specific coupon being required.
Hi @Arohan , You can follow my instructions!
Step 1 : Go to shopify admin → online store → theme → Edit Code
Step 2: Go to price.liquid or the file includes your price
Step 3: Add this code after your sale price like this
{{ product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price | replace: '0,', ''| append: "%"}}
Result:
I hope these instructions will help you. If they are helpful, don’t forget to like and mark as the solution.
Have a nice day sir!
Unfortunately, the price.liquid does not exist in the prestige theme. Where can I insert this code?