URGENT : Compare at price percentage discount With variant product on product details page

New Member
3 0 0

I'd like to show "You save X%" on product pages. This is already done for products with only one variant.  But, for products with multiple variants (e.g. sizes). Because the price changes when we selected a different variant. But, price percentage discount does not worked. 

{% if variant.compare_at_price > variant.price %}You save {{ variant.compare_at_price | minus: variant.price | times: 100.0 | money_without_currency | remove: ‘.0’ | minus:100 | remove:'-' }}%{% endif %}

Someone help me

0 Likes
Astronaut
1890 1 393

At the very least, you will need to edit the selectCallback function.  It might be found in product.liquid or in an asset .js file.  It's difficult to help any further without seeing your shop (or knowing its theme).

0 Likes
New Member
3 0 0

Hi Alex,

Thanks for replay.

I got the solution. I created the custom code for product.liquid file. And it's working now :)

Thanks,

Hardik

0 Likes
Tourist
6 0 1

Hi guys, 

I'm wondering the same thing I am running the SUPPLY theme. which code and where in the liquid can I copy and paste it in to have

1) % off

2) show RRP 

3) a strike out (if possible)

Many thanks!

0 Likes
New Member
1 0 0

Would you mind tell me what your custom code is for this problem? 

 

Much appreciated, 

 

0 Likes