To add VAT validation, please implement the following steps:
Note: to enable automatic checking of the VAT number and tax recalculation as soon as the VAT number is entered, you can add the following line in the Custom Order Field properties in "JavaScript Settings" "OnChange Event" field:
document.order_info.operation.value='refresh';document.order_info.submit();
//$vat_validation = true;
like:
$vat_validation = true;
To specify countries from which users are obligated to pay VAT regardless whether they specify a VAT number or not uncomment the string:
$vat_obligatory_countries = array("GB");
And specify in brackets the country codes with a comma: "GB","FR","LT", etc.
If you don't want to use a third party server validation uncomment the string:
$vat_remote_exception_countries = array("NL");
Then VAT number will be validated for specified countries only with the local regular expressions.