BlueMe Posted January 21, 2016 Share Posted January 21, 2016 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 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 More sharing options...
Guest Posted January 21, 2016 Share Posted January 21, 2016 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 More sharing options...
BlueMe Posted January 21, 2016 Author Share Posted January 21, 2016 (edited) 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 January 21, 2016 by BlueMe (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted January 21, 2016 Share Posted January 21, 2016 Does this help? http://prestacraft.com/adding-new-fields-to-the-registration-form/ Link to comment Share on other sites More sharing options...
BlueMe Posted January 21, 2016 Author Share Posted January 21, 2016 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 More sharing options...
BlueMe Posted January 21, 2016 Author Share Posted January 21, 2016 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 More sharing options...
endriu107 Posted January 22, 2016 Share Posted January 22, 2016 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 More sharing options...
BlueMe Posted January 22, 2016 Author Share Posted January 22, 2016 (edited) Next time I'll read more and do more or go more if only I had looked around a bit more I may have spotted it I was focusing on just one or a few lines of code :D Thank you very much for this! Best regards! Edited January 22, 2016 by BlueMe (see edit history) Link to comment Share on other sites More sharing options...
BlueMe Posted January 22, 2016 Author Share Posted January 22, 2016 Hm... unfortunately it doesn't work properly, it causes an error on the checkout page: Could not save address.I'll look into other solutions and post back. 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