Make sale label show percentage instead (Pipeline)

Highlighted
New Member
1 0 0

Hi! How does one make the "sale" badge display percentage instead? For example "-40%" instead of "SALE". I'm using the theme "pipeline" and have understood you need to edit this in the code.

 

There are multiple threads on this forum which have touched the subject and seem to have given great solutions. None of the solutions are directly applicable on the Pipeline theme though. Could anyone help me with this for Pipeline? 

 

Thank you in advance!

/jonatan

0 Likes
Highlighted

Hi

 

I am not familiar with Pipeline theme itself because I don't have it. But the general way to achieve what you need is:

 

1. Find a place in the code where 'Sale' phrase is used

2. Replace 'Sale' text with this code

 {% if compare_at_price > price %}
 {% assign price_diff = product.compare_at_price | minus: product.price %}
  {{ price_diff | times: 100 | divided_by: product.compare_at_price }} %
 {% endif %}

 

 

If my message is helpful please press Like button.
Design and Development for Shopify https://bulbadev.com
0 Likes
Highlighted
New Member
1 0 0

i cant find the sale phrase in Minimal theme 

how can i find this

0 Likes
Highlighted

Hi Jonnathan, 

Here is the code i added for turbo theme that you can also add on your theme.

Locate the product-details.liquid  file in theme and add/replace this code snippet.

Screenshot (17).png

 

 

<div class="banner_holder">
  {% if product.available %}
    {% if settings.sale_banner_enabled and product.compare_at_price_max > product.price %}
      <div class="sale_banner thumbnail_banner">{{ product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price | money_without_currency | replace: '0,', ''| append: "% OFF"}} 
 {{ 'collections.general.sale' | t }}</div>
    {% endif %}
  {% endif %}
</div>

 

 

Here is the URL for the store where i did. https://pyrogabe.de/

 

Thanks
Arslan Mumtaz 

Shopify Expert | Arslan
Want to modify or custom changes on store hire me.
Skype : arsal.33
Mail : arslan.mumtaz04@gmail.com
Web; shopifydepartment.com
0 Likes