So I basically cloned an eCommerce app to see how the shopping feature worked, and I have followed the same workflow and database with the e-commerce app to build my own, however, my app is currently struggling to calculate the correct total, does anyone know how to solve this problem? Thanks!
(the clothing app is mine, and the one with a drink bottle in cart is the app I cloned)
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 )
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 )
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.
Hey there, I didn’t quite get what you mean, do you mean when a user adds something to the cart I create an update cart action and have a formula in there?