I am running the latest WordPress with the latest WooCommerce, as of this writing.
I have one standard tax rule setup for 20%. This is UK VAT.
I have a product setup at £350. 20% of 350 should be 280.
20 x 350 / 100 = 70
However, on my product page AND checkout basket etc, the amount comes to: 291.67 (ex Tax). This should be 280. This is really wrong! So I'm not sure it's related to how I am coding the output of the product page, since I haven't touched the checkout template at all.
I am not sure if I have set something up incorrectly? Why am I getting such an odd number.
Some rules I have setup:
Yes, I will enter prices inclusive of tax.
Display prices during cart/checkout: Excluding tax.
Shipping tax class: Shipping tax class based on cart items.
I really cannot work this one out.
The tax setup:
The tax on the checkout:
Any help greatly appreciated!
Thanks,
Mikey
I think its correct, its not:
ExVAT = £350 - ((£350 / 100) * 20) = £280
as that's calculating off the price that already includes the VAT, rather its;
20% / 100 = 0.2
0.2 + 1 = 1.2
£350 / 1.2 = £291.67
Related
i've been trying this for while with no success, i'm trying to get the WC_Order_Item_Product applied discount, OR even better, the line subtotal without tax BUT with discount once the order is already created in the backend, example:
(Backend)
Order #xxxx with 20% discount:
Item - Price - Amount - Total
Pen - 10$ - 2 - 16$ (4$ discount)
Jar - 30$ - 1 - 24$ (6$ discount)
Yup expensive jar... so i need either the subtotal (16$, 24$) or the discount so i can make the maths (4$, 6$) and also without taxes (as i said, subtotal).
Tried: $wc_order_item_product->get_subtotal() but it returns the full price without the discount, i need what the customer really paid (with the discount).
Thanks in advance guys, really appreciate it.
If anyone is breaking is head already i've found the solution, the method "get_total()" from WC_Order_Item_Product DOESN'T give the total (sum of price+discount+taxes) instead, it gives the total without taxes (price+discount) =D
The correct price for the product is €38 and VAT is included to the price #23%
In the products page the price 30.89 plus 23% = 30.894*1.23 = 37.99962
But when I add a product and go tho the cart, the total price and the cart prices are out by a cent
the cart is €38 but the check out is €38.01
I tried every combination possible to get both prices correct and I can get €37.99 and €40.01 but I can't get €40 in both carts.
I'm not sure how they could be different I thought they would be going by the same calculation but obviously not.
It looks like a rounding issue. Try increasing the number of decimals in WooCommerce > Settings > General
I am building a Prestashop plugin, and i have stumbled on to this tax calculation issue.
The program flow is as follows:
A person places an order at the eCommerce website, the order is accepted, the order details such as items, prices, taxes, discounts etc is send to an external invoice API service.
An example of an order could be:
(These prices include taxes)
1x T-shirt 20.64
1x Shipping 125
1x Discount -18.58 (In this particular test case, the discount is 90% off the product, the math is simple 20.64 * 0.90 = 18.58)
Order total after tax is applied: 127.06
This is all fine, but, when i send the details off to the API, the order is saved as the following:
(These prices are saved without tax applied, the tax rate being 25%)
1x T-shirt 16.51
1x Shipping 100
1x Discount -14
Order total after tax is applied: 128.14
As you see, the order totals do not mach, the difference is 1.08, i am thinking this a discount & tax issue.
Its worth noting that the external site does its own math on the values sent, e.g products, tax etc. I cannot influence the way the external invoicing site does its calculations. I think the issue occurs in the order of which the operations are performed on the different platforms.
Its also worth mentioning that the code works perfectly fine when there is no discount present.
What can i do prior to sending the values, so that i end up with the same values both places.
The total they compute is indeed (100 + 16.51 - 14) x 1.25 = 128.1375
However their computation of taxless discount is wrong, 18.58 / 1.25 = 14.864 not 14.
Is there a rule that discount should be rounded (or floored or ceiled) to an integer value ?
discount may be non-integer, implying different tax rate
If not that means they divide the discount by 1.32714285714, thus considering there is 32.71...% taxes on discounts. This would be strange and unlikely, since when adding the discount again they use the normal 25%
Check your prestashop documentation, local laws or whatever to find out if this is real, and whether the value is for example 33% or 32.7% Since I reverse-engineered the value from the tax value they stored, it could be distorted by the rounding to 2 decimals.
Then, to get the correct result, replace the discount by discount * 1.32714285714 / 1.25, that is, replace your expected tax rate by the one they apply.
discount is rounded to integer
If the taxless discount does have to be an integer, we can modify it so that it is on our side as well, since I guess what matters most is the final price. So use this algorithm to send in a discount that will finally be an integer:
% get taxless prices
price_notax = price / 1.25
discount_notax = discount / 1.25
% transfer decimal part of discount into price reduction
discount_int = floor(discount_notax)
price_compensated = price_notax - (discount_int - discount_notax)
% re-add tax to get values to send
discount_send = discount_int * 1.25
price_send = price_compensated * 1.25
The sum of values should be the same : price - discount == price_send - discount_send
check if it's not a bug in Prestashop
Update to the latest version, look up their bug tracker or contact them. File a report if there isn't one.
One of the workarounds above will work for now, but if it's a bug that gets fixed and you use the first one, you will be billing wrong amounts again.
I want to apply 25%Tax on Order total amount. In given example it apply on the Subtotal..
Cart Subtotal - 300 ... Shipping - 100 ... Order Total 400 - (Includes 60 VAT)
the 25% of 300 is 60, but I want the result as 25% of 400 is 80.
I really appreciate your help. Thanks
https://wordpress.org/plugins/woocommerce/
Go to WooCommerce > Settings, open tab Shipping, click on your shipping method and set it to be Taxable.
Go to tab Tax, select your desired tax class under Shipping Tax Class.
Open selected tax class settings (click on one of the text links above) and make sure there's a checkbox ticked under "Shipping".
That should be it.
I have a client who asked this.
The original product price is $26. But when we order 2nd product and after that is going to be $22 per item.
So if I order 3 products the total would be 26 + 22 + 22 = $70
Is there a module that can do this or any workaround ? I have searched and I could find a solution for this.
I believe this does what you're looking for, set a price and a min quantity to get that price
Ubercart Volume pricing
You can do a product quantity discount with this module:
https://drupal.org/project/uc_coupon
This module is also another possible solution:
https://drupal.org/project/uc_discounts_alt