Pankaj Yogi
Pankaj Yogi

Reputation: 207

How to add field in registration form?

In my Prestashop I need not add some field in registration form. I tried in authentication.tpl and registration.tpl but not find any hint to add new field.

enter image description here

Upvotes: 3

Views: 13362

Answers (3)

Ultano
Ultano

Reputation: 1

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

I solved it in PS 1.7 by adding in "ps_address_format" table the string " phone_mobile" in the "format" column. I suppose to add other field, this field have to be a field in the table "ps_address".

Upvotes: 0

Dominic Tan
Dominic Tan

Reputation: 111

You may start digging in classes/form/CustomerFormatter.php under getFormat() method. There is an array of fields for the registration form. I would guess you can override that method from your theme folder instead of editing it directly.

Upvotes: 2

sadlyblue
sadlyblue

Reputation: 2987

You can only change the address fields (they appear on registration if you choose the standard registration in Preferences->Customers). To do this, you need to edit the countries required field:Fields

You can also set some fields in the customers menu, at the bottom (if you have b2b enable it will show 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 the fields.

NOTE: these screenshots are from 1.6 but 1.7 country address are identical.

EDIT: Based on your screenshot, you don't have the standard registration option. Not sure it's available in 1.7. Anyway, the phone number field, in Prestashop is related to the addres, and not the customer. It would be easy to remove the other fields, but to add the phone number for the customer and not the address would be a little more tricky and would involve either create an address for that customer, or alter the customer table, class and forms.

One suggestion I can make is to translate the Company field to Phone number, and make it not optional. That would solve one problem.

Upvotes: -1

Related Questions