Jump to content

Require Both Phone Numbers Upon Registration


Recommended Posts

Hi guys, can someone help me with this please?

 

I believe it's a simple mod to do but I don't have the technical background to do it :D

 

Basically what I want to do is have both phone numbers (phone & mobile phone) be required when a new user registers.

 

 

Thank you!

Link to comment
Share on other sites

And what happens if someone does not have a mobile AND a landline?

Think carefully. I am sure you have a valid reason, but it may put customers off. 

Link to comment
Share on other sites

The first/or second phone number will be used for something else.

Some current legislation requires a custom field to be added to PS, and I preffer using this for the moment because I believe I will revert back as soon as the legislation will be cancelled (by a petition).

 

Thank you!

Edited by BlueMe (see edit history)
Link to comment
Share on other sites

It may help but I see in the comments section that someone said he uses One Page Checkout and has some issues with the solution presented. I am too using OPC... so I guess I will be running into the same problem.

 

I will do a test tomorrow (too late now) nevertheless, and I'll post back.

 

Thank you for your assistance!

Link to comment
Share on other sites

Scratch that, I already edited "Phone home" in OPC to be "CNP" (wich is Personal Identification Number) the new law requirement in Romania.

Now I need to find a way to have PrestaShop check both fields "Phone" and "Phone Mobile" to be filled upon new user registration. 

 

I'm thinking that it's just one line of code and I've already tried something but it didn't work, so... is there someone with some PHP knowledge willing to help ?

Thank you!

Link to comment
Share on other sites

I tkink in classes/Adress.php line ~ 120

 

this:

 

'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),

'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),

 

change to:

 

'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'required' => true, 'size' => 32),

'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'required' => true, 'size' => 32),

 

You can try it.

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