How do I add a field to a registration form in prestashop 1.7?

In my Prestashop, I don't need to add any field to the registration form. I tried in authentication.tpl and registration.tpl but couldn't find any prompt for adding new fields. Thanks in advance.

enter image description here

+3


source to share


3 answers


You can start digging in classes / form / CustomerFormatter.php in the getFormat () method. There is an array of fields for the registration form. I would suggest that you can override this method from your theme folder, rather than edit it directly.



+1


source


I had a similar problem because I needed to enable mobile for user registration and for admin use.

I solved this in PS 1.7 by adding the "phone_mobile" line in the "format" column to the "ps_address_format" table. I want to add another field, this field should be a field in the "ps_address" table.



We hope to help you.

0


source


You can only change the address fields (they appear during registration if you choose standard registration in settings β†’ Clients). To do this, you need to edit the required country field:Fields

You can also set some fields in the clients menu at the bottom (if you have b2b it will display other fields) enter image description here

To add different fields you need a module or to edit a lot of files to display and save fields.

NOTE: these screenshots are from 1.6, but the country address for 1.7 is identical.

EDIT: Based on your screenshot, you don't have a standard registration option. Not sure if this is available in 1.7. Anyway, the phone number field in Prestashop is related to the addres, not the customer. It would be easy to remove the other fields, but adding a phone number for a customer rather than an address would be a little more difficult and would require either creating an address for that customer or modifying the table, class, and customer forms.

One suggestion I can make is to translate the Company field to a phone number and make it optional. This will solve one problem.

-1


source







All Articles