Prestige Theme change "on-sale" to % off

Solved
Mr-Flo
Explorer
59 5 25

Good Day,

anyone know how to change the on-sale badge to % off?

I found this code, logic makes sense to me. But Iam unable to find:

{{ 'products.product.on_sale' | t }}
{% if product.variants.size > 1 %}
  UP TO {{ product.compare_at_price_min | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_min | money_without_currency | times: 100 | replace: '.0', '' | append: "% OFF"}}
  {% else %}
    {{ product.compare_at_price_min | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_min | money_without_currency | times: 100 | replace: '.0', ''| append: "% OFF"}}
{% endif %}

 

Iam not interested into an App. 

When someone knows where to put it feel free. Thx

0 Likes
Mr-Flo
Explorer
59 5 25

This is an accepted solution.

Found it, 

Here is the new code: The code now shows -70% 

{{ product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price | replace: '0,', '' | prepend: "-" | append: "%" }}

replace this:

{{ 'product.labels.on_sale' | t }}

Can be found: product item liquid, line around 70 depending on your code.

 

Best

0 Likes
isSalon
Excursionist
13 0 4

Sorry, where do I install/replace this? What is the correct code?

 

I'm looking to do this as well

0 Likes