-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong calculation of total price of cart #544
Comments
I hope i get it right^^: If subtotal is I have written a small test to validate the behaviour and it seems to work as expected. Could you provide the code you use to access the mentioned values? |
The price is 12 for 1 qty including tax 0.8 is multiplier for price without tax (1210.8) subtotal should be then 1210.8 = 9.6 |
Sorry if i get you wrong but why do you want to include the tax of a full item (1qty) when you set it to 0.8 qty? Are you sure the tax sould not be 0.96 * 0.2? Beside that i have no clue why it gives you a subtotal of 12 if you have set the qty to 0.8. Also i am curious about why there are no decimals in your result. The package uses number_format with the values set in your cart config. Did you modify these? It seems to work fine on my end. |
Everything as it should be |
You get me wrong, I call My point is, when I call |
Hey i have this problem:
I have Product with price 12.00, so I call
Cart::add($product)
$product implements Buyable
andgetBuyablePrice()
returns12
My tax in
config/cart.php
is20
So the
Cart::subtotal()
(item * quantity - items tax) should be12 * 0.8 = 9.6
but it is12
And the
Cart::total()
(items * quantity) should be12
but it's14' And finally
Cart::tax()should be
2.4(because only items has price with tax of
12so
12 * 0.2) but it's somehow
2`.Cart::subtotal()
9.6
(12*0.8)12
Cart::total()
12
(only one item in cart with price of12 w/ tax
)14
Cart::tax()
2.4
(12 * 0.2
)2
Could you check this out? Thanks.
The text was updated successfully, but these errors were encountered: