Jump to content

Additional fields on user profile


Recommended Posts

Hello.

I post this message here since I don't find any subforum dedicated to development. I am interested in adding a field to the registration process. In a lot of countries, the National Idenfitication Card (such as DNI in Spain) is a very important data, so it should be included in the registration process.

I was going to add them manually, but I'm afraid it may be a problem for future updates or to use some modules. What is the best way to implement it? Is it a planned future feature?

Thanks for your answers and congratulations for this great shop.

Link to comment
Share on other sites

Hello.

I post this message here since I don't find any subforum dedicated to development. I am interested in adding a field to the registration process. In a lot of countries, the National Idenfitication Card (such as DNI in Spain) is a very important data, so it should be included in the registration process.

I was going to add them manually, but I'm afraid it may be a problem for future updates or to use some modules. What is the best way to implement it? Is it a planned future feature?

Thanks for your answers and congratulations for this great shop.


Hi. I have change "name" translation and put DNI / CIF instead. You can check it www.tuquimica.com
Link to comment
Share on other sites

Good idea, Jose. But we still need to store last names and names in separated fields.

Dtruni, I have not implemented it because I was waiting for a better option. Without having looked at it too much, I suppose the manual way should be too create that column in the database and looking for every place where the user table is used, to add the new field. I think that can be done, but it would surely be a problem when needing to update the shop to new versions.

Link to comment
Share on other sites

Without having looked at it too much, I suppose the manual way should be too create that column in the database and looking for every place where the user table is used, to add the new field.

We did exactly that: creating the fields in ps_customer in the database. Also we added these fields to identity.tpl and authentication.tpl. But it doesn't read manual added values from database nor does it update the database with the entered values at all …

Can someone help out?
Link to comment
Share on other sites

You also need to add the fields to the class definition in the /classes folder. It's for this reason that supporting the changes over newer versions will start to get messy. The answer you seek is in Customer.php (although the ObjectModel class does most of the work for you)!

You will then need to go through all the code that updates Customer objects and make suitable changes to these too. There's not a lot you'll be able to do by just changing the .tpl files I'm afraid.

Paul

  • Like 1
Link to comment
Share on other sites

You also need to add the fields to the class definition in the /classes folder. It's for this reason that supporting the changes over newer versions will start to get messy. The answer you seek is in Customer.php (although the ObjectModel class does most of the work for you)!

You will then need to go through all the code that updates Customer objects and make suitable changes to these too. There's not a lot you'll be able to do by just changing the .tpl files I'm afraid.

Paul


Thanks a lot, that worked :coolsmile:

We had now modified:
/themes/prestashop/identity.tpl
/themes/prestashop/authentication.tpl
/classes/Customer.php
/shop/pswadmin/tabs/AdminCustomers.php
… and the Database with the new fields.
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

I've made it! The only difference is that I've added the custom field to PS Address not PS Customer and modified the coresponding files, but should be the same.

Anyway, best option would be for the client to have an option Company or Person, because to make an invoice for a Company are some required fields

Link to comment
Share on other sites

×
×
  • Create New...