Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arun 29 posts 99 karma points
    Dec 13, 2019 @ 15:58
    Arun
    0

    Get Country Name or ID from Country specific VAT

    Hi, 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

  • Matt Brailsford 2311 posts 11221 karma points MVP 6x c-trib
    Dec 13, 2019 @ 16:09
    Matt Brailsford
    1

    Hi,

    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?

    Matt

  • Arun 29 posts 99 karma points
    Dec 13, 2019 @ 16:20
    Arun
    0

    Thank Matt for the quick response : ) I would like to pick the name of each countries and the VAT percentage. Is this possible?

  • Matt Brailsford 2311 posts 11221 karma points MVP 6x c-trib
    Dec 13, 2019 @ 17:07
    Matt Brailsford
    1

    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.

    Matt

  • Arun 29 posts 99 karma points
    19 days ago
    Arun
    0

    Thanks Matt 😊

Please Sign in or register to post replies

Write your reply to:

Draft