Jump to content

Ps 1.7.8 Mandatory telephone number only for new customers


@diegofrancesco

Recommended Posts

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

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

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