Showing discount percentage on Collection and product page

Kasper4
Tourist
8 0 3

Would greatly appreciate any help!
- Can't figure this one out myself.

I have already tried code that would work on Debut theme.

 

We want to add discount percentage on the product image on both the collection page and product page. 

 

I'm using the prestige theme. 

 

Hope this is enough information to point me in the right direction, sorry for the bad English. discountpercentageUdklip.PNG

 

0 Likes
ocoulombe
Shopify Partner
42 5 6

Hi @Kasper4 ,

Hope you're doing well.

Could you provide your website url?

Thank you

Shopify Partner
Hire me! olivier@letmetalk.ai
Olivier Coulombe-Raymond
0 Likes
Kasper4
Tourist
8 0 3

Hey! 

Sure thing, it's www.inamodus.dk

 

I've managed to put in on the colletion page, but only on the first page and then it swaps back. 
Here is an example: 

On: https://inamodus.dk/collections/udsalg
Off:  https://inamodus.dk/collections/udsalg?page=2 

 

I followed these instructions: 
 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"}} .

in the product.item.liquid

 

thanks!

 

0 Likes
ocoulombe
Shopify Partner
42 5 6

Hi @Kasper4 ,

It does seem weird it works for a second and then doesn't when we change pages or refresh the page.

 

It might require me to look into the code...

What's the theme you're using?

Shopify Partner
Hire me! olivier@letmetalk.ai
Olivier Coulombe-Raymond
0 Likes
Kasper4
Tourist
8 0 3

Yes, it's quite weird.

I'm using the Prestige Theme.

I've talked to the support at Prestige, and they are saying it is because we're using the filter app "Product filter & search"
- I'm still waiting for answer from their support atm.

 

0 Likes