Hi there,
I am building a multi-language and multi-country eCom system with products and variants of various prices and VAT rates. I import an XML file that looks like this:
<Product ID="1" Name="Whatever" .... Color="Red">
<Countries>
<Country langCode="nl-NL" Price="25.99" .... />
<Country langCode="de-DE" Price="27.99" .... />
</Countries>
</Product>
<Product ID="1" Name="Whatever" .... Color="Green">
<Countries>
<Country langCode="nl-NL" Price="25.99" .... />
<Country langCode="de-DE" Price="27.99" .... />
</Countries>
</Product>
I use the Color attribute together with the ID to determine variants (2 in this case, Red and Green) and the Countriesnode to determine localization options.
So far so good; I get nice translated variants for each lanugage.
What I am having problems with is the VAT. I assign price to my variants like this:
myVariant.DefaultPrice = importedNode.Price;
myVariant.Save();
This works fine, and in the backend I see the correct prices showing up in the backend.
In the frontend however, vat is *added* to the product price, even when "Prices in DB include VAT" is turned on.
Eventually, what I need is this:
1. Import prices are as given.
2. Customers should see prices as-is (e.g. 25.99 in NL, 27.99 in DE)
3. I should be able to calculate VAT when I display a single product (e.g. take 19% from the Dutch 25.99 price)
4. I should be able to calculate VAT when I display the complete order
5. I should be able to calculate VAT when I export a single product to a backend system.
6. I should be able to calculate VAT when I export the complete order to a backend system.
7. VAT differs per country. Currently, in each country, I only need one tax rate, but that might change when the products change as well.
Can you recommend some best practices, settings and optionally import code I need to implement this scenario?
If you need more information or want to look at a live site, please let me know.
Kind regards,
Imar