How can I change the sale tag to a discount% tag?

Change the "Sale" tag to a "discount%" tag on the collection pages as well as on the "Featured collection" section of your homepage by doing the following steps: 

1. Go to Online store-> Themes-> Palo Alto theme

2. Click "Actions"

3. Click "Edit code"

4. Search for the "Snippets" folder

5. Open the "product-grid-item.liquid" file 

6. Use CTRL + F to find and replace every instance of "render 'product-badge" with this line of code (there should be six in total):

{%- render 'product-badge', on_sale: on_sale, sold_out: sold_out, badge: badge, price: product.price, compare_at_price: product.compare_at_price -%}

7. Locate the "product-badge.liquid" file in the Snippets folder and replace line 13 with this line of code:

<div class="tag tag--{{ settings.product_badge_style }}"><span>{% if compare_at_price > price %} {{ compare_at_price | minus: price | times: 100.0 | divided_by: compare_at_price | round }}% {% endif %}</span></div>

Click "Save"

Still need help? Contact Us Contact Us