Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I need to set different VAT based on customers country,
How can i get the name of the countries listed in Country specific VAT.?
I have tried GetCurrentVatGroup() and GetCountries() for comparing, but found mismatch in ID
Tea Commerce should do this for you automatically. If you have setup a Vat Group with country specific vat rates, when you set your order to use that Vat Group it will use the orders defined shipping country (falling back to payment country) to work out which vat rate to actually apply.
Are you wanting something other than this behavior?
Thank Matt for the quick response : )
I would like to pick the name of each countries and the VAT percentage.
Is this possible?
If you have a VatGroup already, you can look through it's CountrySpecificVatRates property which is a dictionary with it's keys being currency ID's and it's values being the country specific vat rates.
If you want to get the countries, then you'd have to call CountryService.Instance.GetAll(storeId); to get all countries for a store and then filter it by the keys from vatGroup.CountrySpecificVatRates.Keys.
Does that answer your question?
As I say though, the recomended approach is to set the order shipping country / payment country and Tea Commerce would take care of choosing the right rate for you.
Thanks Matt 😊
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted