Developer forum

Forum » Development » Change VAT when changing country

Change VAT when changing country

Christian Hansen Nørgaard
Reply

Hi DW.

Is there a way to change to VAT in the basket/checkout when changing the Ecom Customer Country? I've got multiple countries with different VAT's and I found a way to update the Ecom Customer Country but the VAT is still the same. I noticed it is because the VAT belongs to the product I've already added so if I remove this product and instead add it again the correct Ecom Country VAT is used.

I was thinking a solution would be to make customers select country on the frontpage but it is not possible - afaik - to loop the Ecom Countries outside the checkout. Any other ideas?

Regards,

Christian


Replies

 
Nicolai Pedersen
Reply

Hi Christian

Do you use ?CountryCode=XX to change the country? Or do you change the customer/delivery country in the cart using the cart fields for country?

And do you have both delivery and customer country set on the cart and the checkbox "UseDeliveryCountry" set?

It could be that the cart does not re-calculate (as it should) when the country is changed.

BR Nicolai

 
Christian Hansen Nørgaard
Reply

Yes I am using the ?countryCode=XX to change to country (and I reload the page upon change). This sets the tags (Ecom:Country.IsCustomerCountryOrDefault and Ecom:Country.IsDeliveryCountryOrDefault) to true. I am not sure what you mean by changing the customer/delivery country in the cart using cart fields?

The cart settings are:

Country for shipping method: Use delivery country if delivery address is set

Country for payment method: Use delivery country if delivery address is set

 
Nicolai Pedersen
Reply

Hi Christian

?countryCode= changes the default delivery country that is used to calculate the default delivery fee. Once you have a cart, you need to change the country on the customer and/or delivery address since that is the one that controls the VAT for the order.

Attached see the setting that also influences how VAT is calculated using either delivery or customer country.

BR Nicolai

Capture.PNG
 
Christian Hansen Nørgaard
Reply

Hi Nicolai.

The setting in your screenshot was already set. :)

I looked at the "Behaviour settings" in this link: http://doc.dynamicweb.com/documentation-8/ecommerce/orders/shopping-cart

This says that VAT is recalculated when billing address is set. Am I missing a setting, tag or other since it won't update the VAT? How do I change the country on the customer or delivery address if ?countryCode is not the way to do it - and without going to the next step (payment provider)?

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You have 2 fields on the order for country - EcomOrderCustomerCountry and EcomOrderDeliveryCountry - that you set the same way as other order fields from the template.

Attached an example template that uses the country loop to display a select box

Votes for this answer: 1
 
Christian Hansen Nørgaard
Reply

Ah of course.. I was missing the onchange=updateCart() function on my select. I made up my own and used the ?countryCode and reloaded the page instead.

Thanks for your help. :)

 

You must be logged in to post in the forum