PrestaCraft on Facebook

Please like our page on Facebook to get notifications about new tutorials :)



After quite big success of my tutorial about adding new fields to the registration form in PrestaShop 1.6 I’ve decided to create one for 1.7. There are some similarities according to 1.6 version.

Looking for PrestaShop 1.6 version of this tutorial? Click here!
Before any changes, please remember to do a backup of all your files! I don’t take any responsibility for presumable inconveniences or bugs which may occur after those modifications.

FrontOffice modifications

Let’s start with adding new columns called my_field and my_field_required to the ps_customer table . Go to your phpMyAdmin and execute the following SQL command.

Edit: classes/form/CustomerFormatter.php

Now it’s time to edit CustomerFormatter class to make our fields visible in the registration form.


Add before:

Of course, you can change the position of new fields and put it wherever you want.

Edit: classes/Customer.php

Now, extend your Customer model by adding new columns. You can also add there a validation and determine if the field must be required.


Add after:


Add after:

Save the file and go to your customer registration form page. You should see something like this:

Remeber that your customers are now able to edit values of those fields in the Information section in the My account page. In the form you can see after clicking on:

That’s enough – time for the backoffice.

BackOffice modifications

Let’s display our fields in the BackOffice > Customer Settings > Customer Settings.

First, you must just add new form fields in the Admin Customers Controller. Look at the code.

Edit: controllers/admin/AdminCustomersController.php


Add after:

Now if you go to the customer creation/edit form you are going to see two new fields:

Time to display the data in backoffice customer page.

Edit: adminXXX/themes/default/template/controllers/customers/helpers/view/view.tpl

Add after:

Now your values are visible as you can see below:

Add your new field to the BackOffice Customer table

If you wish to display your field in BackOffice Customer table (in the Customer Settings -> Customer Settings tab), you must edit AdminCustomersController and make it aware of the new field.

Edit: controllers/admin/AdminCustomersController.php

Add after:


Add after:

Save the file and you’ll see new columns in this table:

Set overrides

Last and very important thing is to move all Your changes to override/ directory.
1. Copy and paste files:

Source Destination
controllers/admin/AdminCustomersController.php override/controllers/admin/AdminCustomersController.php
classes/Customer.php override/classes/Customer.php
classes/form/CustomerFormatter.php override/classes/form/CustomerFormatter.php

2. Replace in DESTINATION files:
class AdminCustomersControllerCore extends AdminController replace with class AdminCustomersController extends AdminCustomersControllerCore
class CustomerCore extends ObjectModel replace with class Customer extends CustomerCore
class CustomerFormatterCore implements FormFormatterInterface replace with class CustomerFormatter extends CustomerFormatterCore

3. Purge cache:
Remove /app/cache/ directory.

That’s it. Thanks for reading. If you face any problem or just want to say “thank you”, leave a comment here. If you like my articles and modules, please consider donation.

Comments about this post (24)

Add a comment
PrestaCraft 02-06-2019

Please turn on error displaying and paste here the error message. Without it I would not be able to help you.
turkmen 01-06-2019
I have give error 501 also not to be return default settings.
Tony Id 16-04-2019
Nice Tutorial.. Please can you make another tuttorial Adding new fields to the address form, prestashop 1.7
hamilton 05-04-2019
Hello, Thank's, very simple and work fine.
But in my side, it work without the last session ' Set overrides'...
Please tel me why we must move files and edit them?
Yumi 04-03-2019
Great and very useful tutorial. Thank you! How can I add dropdown list in CustomerFormatter? Can you provide sample. Thank you in advance!
Mastek 18-02-2019
Thank you for the tutorial, it helped me a lot because I was looking for it.

But I have one big request.
Can You add to the guide the tutorial how to add this "new fields" to email templates:
- order to the customer
- order to the admin (mail alert)

Thank you again,
thank you for tutorial.
matteo 18-01-2019
Is there a way to make this field visible only if cart contain at least one product from a list of category set by me?
Riccardo 15-01-2019
mohamed 31-10-2018
this is brilliant


i have one question, why i cant add these fields in address format under the country settings ?
shadMod 14-10-2018
Fantastic!! Thanks!!
Francesco 06-10-2018
Awesome, very good tutorial! Thank you so much!
Jules 09-08-2018
This tuturial ended up being extremely helpfull, thanks a lot.

I spotter a typo though
"Remeber that your customers are now able to edit values of those fields in the Information section in the My account page. "

Turpin 08-03-2018
Great thank you very clear , works like a charm.
But there is a small problem in admin customer dashboard cause it create one more in my customer table so it push "modify" column to the right and goes outside of panel col-lg-12. is there anyway to solve this ? Thank You
Jean-Pierre 20-11-2017
Problem solved... i made a mistake in a mofication by using the sign - rather than the sign _ in my field name...
Jean-Pierre 20-11-2017
I've added a filed named "agent_id_required" as shown in this tutorial. All seems to work correctly.
However in the administration panel when i do a Manage Customer i get this error message:

Bad request SQL
Unknown column 'agent_id' in 'field list'

What could be wrong ?

Thanks for help
PierreB 23-08-2017
Very good tuto
For the translation, I don't find the field :( ...Where I can find ?
PrestaCraft 22-08-2017
You are right, it is correct now, there was a typo in filename.
Fabio 21-08-2017
The "public $groupBox" is not in CustomerFormatter.php is in the Model Customer.php
Fabio 21-08-2017
Nice tutorial, i'm having problems saving the information in mysql database.
When i click the save button in the registration form the information is not stored in mysql, it's blank.

Do we have to clean smarty cache to this working?
daniel 20-08-2017
Having same problem as Yan.

"public $groupbox;"... is not showing up on ../customerformatter.php
Yan 19-08-2017
Also in Edit: controllers/admin/AdminCustomersController.php


) as connect,

to add:

my_tlf_required, my_dis_required, my_dir_required, my_cps_required
Yan 19-08-2017
Hi and thank you for the guide!

Im trying to add new fields into my registration for m for new users in my store, following the next guide:


But im having some troubles with this due to some code not displayed in my CustomerFormatter.php file...or its just me or there is no such code inside as writed in that guide.

Here is the deal:

Now, extend your Customer model by adding new columns. You can also add there a validation and determine if the field must be required.

public $groupBox;

public $my_field;
public $my_field_required;

'table' => 'customer',
'primary' => 'id_customer',
'fields' => array(

'my_field' => array('type' => self::TYPE_STRING),
'my_field_required' => array('type' => self::TYPE_STRING, 'required' => true),

I've created 4 new columns in my ps_customer table.

which are:
ALTER TABLE ggwplayc_customer ADD COLUMN my_tlf_required VARCHAR(250);
ALTER TABLE ggwplayc_customer ADD COLUMN my_dif_required VARCHAR(250);
ALTER TABLE ggwplayc_customer ADD COLUMN my_dir_required VARCHAR(250);
ALTER TABLE ggwplayc_customer ADD COLUMN my_cps_required VARCHAR(250);
After that Ive made and added next code as stated in the guide.

$format['my_tlf_required'] = (new FormField)
'Telefono', [], 'Shop.Forms.Labels'
$format['my_dif_required'] = (new FormField)
'CIF/NIE/DIF/PASAPORTE', [], 'Shop.Forms.Labels'
$format['my_dir_required'] = (new FormField)
'Direccion', [], 'Shop.Forms.Labels'
$format['my_cps_required'] = (new FormField)
'Codigo Postal', [], 'Shop.Forms.Labels'
So yeah the problem is i cant find the code he is asking me to find lol in that specific .php file :(((

any ideas?
el_lo 28-07-2017
Nice tutorial, thank you ! How can we translate the 'My field required' ?
I can't seem to find it in International / translations. I'm searching in Shop-Forms-Labels but there is nothing there. Kind regards.

Leave a comment

Your email address will not be published.