Hi, I am using the Dawn theme 9.0 and I have been searching the forum on how to show the customer how much they are saving in %, but all solutions online seems outdated. I would like either the “Rea” (Sale)-badge to show -20%, or have a text below the price like “Save 20%”.
Ideally I would like to add this to both collection pages and product pages.
Do anyone have a solution for this that works with this version of the theme?
Open the collection-template.liquid file and find the section where the product listings are rendered. This section might be named something like {% for product in collection.products %}.
Inside the loop, locate the code responsible for displaying the product price. It might look similar to {{ product.price | money }}.
To display the percentage savings, you can calculate it by subtracting the sale price from the regular price, dividing it by the regular price, and multiplying by 100. Here’s an example of how you can implement this calculation:
@FriEqv - are you familiar with the coding? if yes then you can try solution given by @NomtechSolution , else you will need to get someone who knows how to make code changes
Im not a pro but usually I can figure it out. But I don’t even find any of those elements he mentioned or variations of it in my code unfortunately so I don’t know where to look.
@FriEqv - please check if you have code which has name badge… you can search this element in card-collection.liquid file… this will surely be in your product liquid template file
To implement the same kindly use the below card since you have card-collection.liquid file you should find the class named badge and update the code inside the tag with below code.