Hello, i would like to change the text for my sale badge on my product page. I have changed it for my product card so that it says “SAVE ___(saved price)”. I did this by going to my default theme content and changing the sale button to say “SAVE” then I just added some code at card-product.liquid so that it would say the saved amount aswell. Im just looking for some similar code which will work for my product page, thanks
website is www.marcomontesi.com , theme is dawn
Hi @ads18922
Please open price.liquid file under Snippets folder, find this line of code {{ ‘products.product.on_sale’ | t }}, add this code below it
{%- assign percent = compare_at_price | minus:price | times: 100 | divided_by:compare_at_price | round -%} {{ percent }}%
hello, instead of it being the percentage saved, can you make it the price saved , like the product card
Please update the code.
{%- assign ammount = compare_at_price | minus:price -%} {{ ammount }}%
Hi @ads18922
To modify the “SAVE” text in the en.default.json file of your store, follow these steps:
- Open the en.default.json file in your store’s theme.
- Search for the term “SAVE”
- Change the the text you want
I hope this helps
Best,
Daisy
Sorry, please update the code
{%- assign amount = compare_at_price | minus: price -%}
{{ amount | money_without_trailing_zeros }}
thats great, one last thing would you be able to change the badge so that instead of curved corners, it is a rectangle instead - like my product card. Also can you make the badge smaller on product page, thanks!