Jump to content

[SOLVED] How to change: Recquired Phone Field must be Numeric


Recommended Posts

Customer account setup: I've changed my fields and made the mobile phone field a sales tax permit field. It's still set up as a numeric number which has worked until recently. Now I have customers with Alphanumeric sales tax numbers and they can't enter the letters. How can I take the restrictions off the phone field? It still needs to be required.

Link to comment
Share on other sites

You will need to change the phone number validation code on lines 4[spam-filter]494 of classes/Validate.php (in PrestaShop v1.3.2):

static public function isPhoneNumber($phoneNumber)
{
   return preg_match('/^[+0-9. ()-]*$/ui', $phoneNumber);
}



For example, to allow a-z to be entered, change line 493 to:

return preg_match('/^[+a-z0-9. ()-]*$/ui', $phoneNumber);

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...