soloporteros Posted September 26, 2008 Share Posted September 26, 2008 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 More sharing options...
jose27madrid Posted September 27, 2008 Share Posted September 27, 2008 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 More sharing options...
dtruni Posted September 29, 2008 Share Posted September 29, 2008 Can you quickly show us how to add such fields the manual way? Link to comment Share on other sites More sharing options...
soloporteros Posted September 29, 2008 Author Share Posted September 29, 2008 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 More sharing options...
dtruni Posted September 30, 2008 Share Posted September 30, 2008 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 More sharing options...
Paul C Posted September 30, 2008 Share Posted September 30, 2008 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 1 Link to comment Share on other sites More sharing options...
dtruni Posted September 30, 2008 Share Posted September 30, 2008 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. 1 Link to comment Share on other sites More sharing options...
shutzu Posted February 19, 2009 Share Posted February 19, 2009 can you please explain what exactly what you modified? I've tried modifying these files and the db, but it's not working... Link to comment Share on other sites More sharing options...
shutzu Posted February 20, 2009 Share Posted February 20, 2009 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 More sharing options...
Recommended Posts