I want to replace the “sale” label in the product collection page with a discount label in the form of a percentage
And here is my shopify website:https://thefolls.com/collections/best-seller
This is the current style:
This is the style I want:
Any help is most welcome.
Thank you
Follow the below steps to achieve your requirement. I hope you have knowledge of liquid code.
- From your Shopify admin, go to Online Store > Themes.
- Locate the Impulse theme and click on the “Actions” button, then select “Edit code” from the dropdown menu.
- In the left sidebar, under the “Sections” folder, click on “product-card-grid.liquid” or “product-card-list.liquid” (depending on the view you want to modify).
- Look for the code that outputs the sale tag, which is typically represented by {% if product.compare_at_price > product.price %}.
- Replace the existing code that displays the “Sale” tag with the following code to show the discount percentage:
{% if product.compare_at_price > product.price %}
{{ product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price | money_without_currency | remove: '.00' }}% Off
{% endif %}
- Save the changes to the file.
Please note that modifying the theme code requires some technical knowledge.
The impulse theme does not have any of those views in the sections:
on “product-card-grid.liquid” or “product-card-list.liquid”