Vuestorefront not using correct tax and price in cart

93 Views Asked by At

I am having an issue with Vuestorefront and Magento 2 regarding the tax calculations and prices in the cart.

I have a BE and an NL store set up, both have tax zones configured for the required percentages (as depicted in the screenshot below).

As you can see, I have mapped the "BE 6%" and "NL 6%" rule to the "6%" tax class. And the "BE 9%" and "NL 9%" rule to the "9%" tax class.

I have created a product that is available in both stores. For "All store views" I have set the Tax class to "6%". For the NL store view I have overwritten the Tax class with the value "9%". When I add the product to the basket, and VueStorefront fetches the shipping information, I am getting the "NL 6%" rule applied, instead of the "NL 9%" rule. I am assuming that because Magento is applying one of the NL tax rules, that the region is determined correctly, it seems to me that for some reason the wrong store is applied to the cart.

Has anyone had this issue before?

tax rules tax zones

1

There are 1 best solutions below

0
On

After some more investigating, it appeared that the storecode wasn't being set correctly when making a call to the Magento API. The storecode configured in Vuestorefront didn't match with the storecode set in Magento (we used 'nl-nl' in Vuestorefront while the storecode in Magento was 'nl_nl'. This caused the Magento API to switch to the default store, hence the wrong information.