Jump to content

[SOLVED] Authentication/Addresses 'Home Phone' field to change to 'email address' - How can this be done?


Recommended Posts

When a cutomer registers an address there are two fields, one for home phone and one for mobile phone. I will change the text in Translations to say instead 'email address' and 'contact phone'. I have found in the address.php where to make sure that the box accepts upto 50 characters - that is not a problem - but it wont let me type in any text. only numbers.

What do i have to change so that the 'phone' field can accept an email address instead?

Link to comment
Share on other sites

Basically I am using the 'add address' also for delivery of gift cards (voucher codes).

So if a customer buys a gift card they can have it sent directly to the recipient. The recipient may not necessarily be registered with my shop but I need their email to enable me to send the voucher code.

Link to comment
Share on other sites

You need to change line 89 of classes/Address.php (in PrestaShop v1.3.2):

'phone' => 'isPhoneNumber', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool');



If it is the "Phone number" that you changed to "Email address" and "Mobile phone" that you changed to "Contact phone", then you will need to change it to:

'phone' => 'isEmail', 'phone_mobile' => 'isPhoneNumber', 'deleted' => 'isBool');

Link to comment
Share on other sites

Ok, now it lets me input an email address, very good.

But now it only saves the first 16 characters of the email - even though I changed the field length from 16 to 30. Is there somewhere else, another file I also need to change?

'phone' => 30, 'phone_mobile' => 30);

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