How to do simple calculation / price

New Member
2 0 0

Hey community, 

 

I wanted to do some simple price/discount calculation in HTML. 

 

The following code was used:

 

{{ current_variant.price | divided_by: 100.00 | times: 45.00 | money}}

 

Unfortunately, we have different sizes with different prices. When I click on another size, the price on top (the original one) adapts automatically, but the one I want to calculate does not.

 

Can somebody tell me how the right formula for the price calculation looks like? 

 

Hope somebody out there, wants t help me :)

 

Kind regards

0 Likes

Hello 

{{ current_variant.price | divided_by: 100 | times: 45}}

{{ current_variant.price | times: 45 | divided_by: 100 }}

Want to modify or incorporate custom changes on store, Hire us.
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Free Review and advice for sale on store | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | SEO & Digital Marketing | Site Speed Optimization | Performance Site Audit
0 Likes
New Member
2 0 0

Hey, thanks for the advice. 

 

However, there still is a problem of different prices in variants which do not update automatically. Is there any code I can use so that the prices with the code do automatically update when clicking on another variant?

 

Kind regards

0 Likes