Checkout total calculation not working

Hi @MaxZHou,

Based on the formula I think that’s the total has to be.

Calculation

46 + 17 = 63
1 + 3 ( quantities) = 4
sum of price * sum of quantity = 63 * 4 = 252 ( This is not the result you get. I checked your app and the prices for these are decimals )
image
image
45.99 + 16.99 = 62.98
1 + 3 ( same quantities ) = 4
sum of price * sum of quantity = 62.98 * 4 = 251.92 ( and this is the result you got )

I believe what you have to get is :

45.99 * 1 = 45.99
16.99 * 3 = 50.97
cost = 45.99 + 50.97 = 96.96

What you can do is when adding items to cart ( creating a record in the cart collection ) you can directly multiply the price by the quantity and do the same thing for add and minus button and display the price.

You can check here a example : Renew order items quantity - #11 by dilon_perera

Added this to your app and you can check!

Let me know if all works!

Thank you

1 Like