Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Diego

    (@daigo75)

    We haven’t planned a feature to allow the validation of VAT numbers outside the checkout process. The checkout is the scope of the VAT MOSS regulations, for which this plugin was written.

    I’m going to take note of this request for a future version, it might come in handy. In the meantime, you can perform the validation by calling the functions used by main plugin class. If you look for function set_vat_exemption, you can see how the validation class is used. You will have to pass a country code and a VAT number to it, and it will return a result telling you if the number is valid

    Thread Starter kevingobert

    (@kevingobert)

    Hello,

    Ok good. I will use this function.

    Thank you for this quick response

    Thread Starter kevingobert

    (@kevingobert)

    I just watch but the functions are protected

    Thread Starter kevingobert

    (@kevingobert)

    By analyzing your code, I saw that you allowed to check with ajax. At first I will use the ajax to do the validation.

    For people who is asking the question here is the url format wp-admin/admin-ajax.php?action=validate_eu_vat_number&country=COUNTRY_ISO_CODE&vat_number=VAT_NUMBERS

    Plugin Author Diego

    (@daigo75)

    You don’t need to call the protected function. This call would work just fine:

    
    $validator = \Aelia\WC\EU_VAT_Assistant\EU_VAT_Validation::factory();
    $validation_result = $validator->validate_vat_number($country, $vat_number);
    

    You can then find the result in the validation in $validation_result.

    Thread Starter kevingobert

    (@kevingobert)

    Ok good. Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add VAT number field in register’ is closed to new replies.