@diegofrancesco Posted September 18, 2023 Share Posted September 18, 2023 Hello, I know how to make the phone number mandatory, but I need to do it only for new customers. If I activate the checkbox to make it mandatory in Prestashop 1.7.8.9 I noticed that those who are already customers receive an error message during checkout because the address is incomplete (when the telephone number is missing), and this is a problem. In the previous version of the site, Prestashop 1.7.2.4, I had made the telephone field mandatory, but old customers who had not entered it did not receive an error. I don't remember making any changes to the code in that case. Thanks in advance to anyone who will help. Link to comment Share on other sites More sharing options...
Nickz Posted September 18, 2023 Share Posted September 18, 2023 (edited) You'll need to script something together where you check an ID (if existent than false). Edited September 18, 2023 by Nickz (see edit history) Link to comment Share on other sites More sharing options...
endriu107 Posted September 18, 2023 Share Posted September 18, 2023 I think you need to make changes in Validate class there is isPhoneNumber() function that checks is phone number correct. You can try add there statement checking if customer is logged or not and then use validation or not. Maybe you need to also make changes in form-fields.tpl in your theme. Link to comment Share on other sites More sharing options...
@diegofrancesco Posted September 19, 2023 Author Share Posted September 19, 2023 I'll try to do as you both said, see if I can do it. Thanks 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