Jump to content

[AIDE] OBLIGER numéro de téléphone 10 CHIFFRES prestashop 1.7


Recommended Posts

  • 1 year later...

Bonjour, 

il faut chercher Classes/Address.php  ligne 137 et passer 'size' de 32 à 10. 

  'phone_mobile' => ['type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 10],

On peut aller plus loin si on ajoute une nouvelle expression dans Classes/Validate.php en dessous de isPhoneNumber 

public static function isPhoneNumber_mob($number)
    {
        return preg_match('/^[+0-9. ()\/-]{10}$/', $number);

    }

cela refusera le formulaire si les 10 chiffres ne sont pas atteints. 

Edited by Kevlarbox (see edit history)
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...