First you will have to do the following:
Under 'Settings' -> 'Advanced Settings' -> 'Basic Setting' -> 'Other shop
settings' you will find Swap the first and second pages of the order process? Choose Yes.
The second order step (address entry) will be displayed before the first one
(select delivery and payment method).
Thus you can access the country given by the customer in a rule for the first order
step (which is now displayed as the second one).
Now enter the following code under 'Settings' -> 'Advanced Settings' -> 'Payment methods' -> 'Settings for all payment methods'Here you should see 'Rule for all payment methods':
Note: strstr function finds the first occurrence of a string. So in this
if ($country == "UK")
elseif (strstr("CA MX FR", $country))
elseif (strstr("IN SG MY", $country))
You can find the country codes at: 'Settings' -> 'Advanced Settings' -> 'Text modules 1' -> 'Texts for the country, state, and province lists' Here you can see 'List of countries for country selection'
If 'Swap first and second order pages?' has been selected, then an entry must be
made in the Country field, otherwise the tax area cannot automatically be selected
on the following page.
Please note that this rule will cause an error message if you cancel swapping the
first and second order pages.