Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Printer Friendly Tell a Friend

Add VAT validation field

To add VAT validation, please implement the following steps:

  • 1. Add a field (e.g. "VAT Number") at:
    Settings > Orders > Order Profile Page > Custom Order Fields > Add New
    where set "Field Type" to "Shopping Cart" and "Field Control" to "TextBox". Also specify "Show Field: For All Orders".

    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();


  • 2. Next open your 'var_definition.php' file from the 'includes' folder and uncomment the following string (it will enable the VAT number validation on the remote server):

    //$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.