Prestige: Change "On Sale" badge to "xx% OFF"

Tourist
6 0 1

Theme Prestige

I would like to change the badge "on sale" to "--% Off" - the percentage calculated from the sale price vs original price.
Thank you for your help!

Shopify Partner
12398 1505 4493

Hello, @plejbela 

Welcome to the Shopify community!
and Thanks for your question.


Please share your site URL,
So I will check and provide a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
Shopify Expert
4038 563 967

Hi @plejbela 

You can find your grid code in Snippet->product-grid file and find sale code where you can change badge to this code:

{{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0'}}

 This code will calculate discount of price  

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Tourist
6 0 1

Thank you for your comment. 

The site has not been published yet. .

I found some specific instructions to do this in other themes. I was wondering if there are any codes that enables Prestige to change the badge?

 

0 Likes
Tourist
6 0 1

Dear @Jasoliya

Thanks for your help.

There seems to be no "product-grid" file (no "product-grid.liquid" file either) in Prestige (in Snippets).

Am I looking in the wrong place?

0 Likes
Shopify Expert
4038 563 967

You can find it on "product-item" file if you have.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
Tourist
6 0 1

I've tried many variations and this worked for me. 

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

Thanks for the advice!

0 Likes
Shopify Partner
222 17 84

Hey @plejbela,

I noticed that you wanted to apply discount badges (with % value) on your catalog images.

We have developed an app (Modemagic) that will help you add product stickers/badges on your catalog within seconds. And we have an extensive collection of customized stickers based on different occasions (Sale & Discounts, Pre-Order, Trust Badges and much more) You can also create custom badges based on what copy you prefer.

Over here, you can choose what value of discount you would like in the badge, customizability is available.

Screenshot 2020-08-19 at 12.54.04 PM.pngScreenshot 2020-08-19 at 12.54.32 PM.pngScreenshot 2020-08-19 at 12.55.19 PM.png

No complex edits, no back & forth with designers. Update your store within seconds! And it's free.

Don’t find a sticker that meets your need, reach out to us on chat for a custom design. We also create stickers in various languages. Check out this app on Shopify here.

Hope this helps

Fayaz

ModeMagic
Featured on Shopify Staff Picks
0 Likes
New Member
1 0 0

Hi @plejbela ,

Can I ask you where exactly tou placed this code?  

I am using the prestige theme too, but I'm not quite sure where to put it. Under my snippets - product.item.liquid - I found this code:

 

{%- if product.available -%}
{%- if product.compare_at_price > product.price -%}
<span class="ProductItem__Label ProductItem__Label--onSale Heading Text--subdued">{{ 'product.labels.on_sale' | t }}</span>
{%- endif -%}

 

Would it be around here?

 

Thanks!

0 Likes
Tourist
6 0 1

Yes, you can try replacing {{ 'product.labels.on_sale' | t }} with {{ product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price | replace: '0,', ''| append: "% OFF"}} .

Make sure you save your original coding in case something went wrong.

Good luck

 

 

0 Likes