Hello community,i need ti change the sale card button from “on sale” to “Save %” for every product and in every page that they shows
Topic summary
A user wants to replace the “On Sale” badge with a “Save %” discount percentage across their Shopify store (homepage, collection pages, and product pages).
Solution Provided:
- Another user shared a tutorial link with step-by-step instructions
- The original poster confirmed this solution worked for their store
Follow-up Issue:
- A different user (irisbr325, using Refresh theme on seapuri.sg) attempted the same fix but encountered problems
- Specific guidance was provided: locate
card-product.liquidin the Snippets folder, find line ~140 containing{{- 'products.product.on_sale' | t -}}, and replace with custom code that calculates the percentage discount - The user reported the code replacement didn’t work as expected and included a screenshot showing their attempt
Current Status:
- The issue remains unresolved for the second user, who is seeking clarification on the correct implementation method
Hi @VisarK
I wrote a post to provide a guide on how to do that. You can check it out here.
Thanks a lot @Dan-From-Ryviu it works
You are very welcome!
Hi @Dan-From-Ryviu I need some help here.
This is my URL seapuri.sg
I would like to add the save % on my collection page/home page.
I tried your well organized tutorial but it didn’t work on my refresh theme.
Can I get some help please?
Hi @irisbr325
-
Go to Online Store > Themes > Edit code
-
In Snippets folder, find and open card-product.liquid file.
-
Find this line of code {{- ‘products.product.on_sale’ | t -}} around line 140.
-
Replace the above code with this code.
{%- assign percent = card_product.compare_at_price | minus:card_product.price | times: 100 | divided_by:card_product.compare_at_price | round -%}
Save {{ percent }}%
Hi thank you for your prompt response!
I tried replacing the code but it didn’t work..
Is this the correct way of replacing the code?
I tried replacing only the {{- ‘products.product.on_sale’ | t -}} code and leaving other two code next to it but it didn’t work as well.
How can I resolve this issue?




