parat10 Posted January 30, 2014 Share Posted January 30, 2014 Hello, I need to validate VAT number in registration form. I made new function in Class/validate and in class/adress change in $fieldsValidate vat_number => isGenericName to =>myFunction. And nothing happend. What should I do? Anyone any help or advice? Thanks Link to comment Share on other sites More sharing options...
parat10 Posted January 30, 2014 Author Share Posted January 30, 2014 PrestaShop™ 1.4.10.0 Link to comment Share on other sites More sharing options...
selectshop.at Posted January 30, 2014 Share Posted January 30, 2014 Activate the VAT module on your back-office -> modules. Set to automatic validation: Enable checking of the VAT number with the WebService Link to comment Share on other sites More sharing options...
parat10 Posted January 30, 2014 Author Share Posted January 30, 2014 It is not working in my country and it's super slow. Is there any solution only with regular expression (I don't need to validate if it's real, only if it's in right form). Thanks Link to comment Share on other sites More sharing options...
vekia Posted January 31, 2014 Share Posted January 31, 2014 can you show how your functions looks like? (you said that you created own validate function) Link to comment Share on other sites More sharing options...
parat10 Posted February 2, 2014 Author Share Posted February 2, 2014 In validate.php in ValidateCore: public static function isDicCZ($vat_number) { return preg_match('^[a-zA-Z]{2}[0-9]{8,10}$', $vat_number); } In adress.php in $fieldsValidate: 'vat_number' => 'isPostCode', Link to comment Share on other sites More sharing options...
parat10 Posted February 2, 2014 Author Share Posted February 2, 2014 (edited) Please, any idea? I am absolutly desperate. Thanks. Edited February 3, 2014 by parat10 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 4, 2014 Share Posted February 4, 2014 in fact each country has a little different method to create vat numbers. it mean that each country must use different validation method. in addition, if structure of vat is valid, it doesn't mean that this vat number exists! this is why it's necessary to validate it with your tax government services, for example VIES. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now