π£ The forum has moved to GitHub
Weβve switched to GitHub Discussions as the hub for our community. This will improve the experience of collaborating for everyone, sharing what youβre working on, and discussing ideas for how Swell can be improved. Existing threads will remain open, but new posts are disabled.
Go to GitHub βWhy are taxes not being calculated at checkout?
I've noticed that taxes are not being calculated at checkout (like, at all).
There is an active tax rule in place:
These are the calculation options:
And this is what I see during checkout at the "payment" step (after setting an address that should apply the aforementioned tax rule):
So the tax calculation is somehow not being triggered at all.
At the moment I activated the realtime order webhook, which I am responding to with:
{ items: itemsWithTaxes, shipment_tax_included: false, shipment_tax, taxes}
itemsWithTaxes
being an array of items with the amount of taxes applied to each.shipment_tax
being the total amount of taxes that should apply to the selected shipment method.
This will work fine and the customer will see the total amount of taxes during checkout (and in the invoice).
All taxes (items and shipping) will be grouped in one single statement ("Taxes"), though. So I tried passing taxes
as well, as you can see above. This is in an attempt to separate taxes on items and on shipping.
taxes
is an array, e.g.:
const taxes = [ { id: 'sales-tax-shipping', amount: shipment_tax, name: 'VAT (Shipping)', rate: taxRate, shipping: true, }, { id: 'sales-tax', amount: item_tax, name: 'VAT', rate: taxRate, shipping: false, }, ]
Not sure if this is how it is supposed to work anyway - just trying things out. The docs do not cover this very extensively.
Long story short, I have two questions:
- Why aren't taxes being calculated automatically, as expected?
- Is there a way to separate taxes applied to "standard" items from those applied to shipping fees?
Thanks in advance!
Answers
-
Hi @Oleg, Thanks for the detailed information.
I could see the last 5 carts which have the taxes calculated correctly as expected. Could you please confirm whether your issue is resolved at your end?
Sharing the screenshot for reference:
CartΒ 100049
Is there a way to separate taxes applied to "standard" items from those applied to shipping fees?
Yes definitely. You could create 2 tax rules. One for product and another for shipping alone. Does this work for you?
Hope this answers your question. If not, please reply to this thread and I am happy to answer you.
0 -
Thanks for the reply.
No, it still doesn't work. Those taxes you mention have been calculated manually using the realtime order webhook (the way it is described in the original post).
So basically if I do not calculate them manually on my end using the webhook, no taxes will ever be calculated/included by Swell.
0 -
Also another observation:
It seems that taxes do work when items are added to the cart using "swell.cart.addItem()", but not when "swell.cart.setItem()" is used instead. This might be the bug on your end.
What do you think?
1 -
Tax calculation is all over the place, unfortunately.
Incorrect taxes and net amounts are displayed from checkout through carts to reporting.
1