Help me add custom fields to PrestaShop?
August 7, 2014 1:32 PM Subscribe
I'm trying to add a field to a customer registration form in PrestaShop 1.6 but after studying the documentation and a straightforward tutorial from a forum mod, it's not working. Help me extend my PrestaShop, please?
I've been playing around with PrestaShop lately and it's a nice system. I'd like to use it for a project or two in the future so I'm trying to learn how to customize it, but so far it's proven to be confusing and sparsely documented (at least 1.6). The forums seem to be populated with more people looking to get paid than necessarily help you figure it out on your own, though I've only been reading them for the past few weeks. It also seems to take a long time to get any responses.
What I'm trying to do is simply add another field for customers - newfield - to fill out when registering. I've read the docs and followed a tutorial created by a forum mod to extend PS 1.6 objects. Although I can get the field to show on the registration form, no information is inserted to the database. Turning on Dev Mode shows no errors. It looks to me like the customer controller is very different than the objects the tut is talking about.
Can anyone help me decipher where I'm going wrong in this endeavor? The steps I've taken are...
1. Created a new text field in the database, newfield.
2. Created a new file, Customers.php, in "override/classes" and put in what the tutorial implied was the correct class snippet to override.
3. Copied the "renderForm()" method from "controllers/admin/AdminCustomersController.php" to a file of the same name in "overrides/controllers/admin", modified the method to add my field info and edited the last line to read "return AdminController::renderForm();"
4. Added the field html to the authentication.tpl file in my theme
(there is more but this is all that is germane to getting the data to the database)
The field shows up in the form and registration goes through without errors but there is no data in the database.
What am I doing wrong? Where else can I go for help?
I've been playing around with PrestaShop lately and it's a nice system. I'd like to use it for a project or two in the future so I'm trying to learn how to customize it, but so far it's proven to be confusing and sparsely documented (at least 1.6). The forums seem to be populated with more people looking to get paid than necessarily help you figure it out on your own, though I've only been reading them for the past few weeks. It also seems to take a long time to get any responses.
What I'm trying to do is simply add another field for customers - newfield - to fill out when registering. I've read the docs and followed a tutorial created by a forum mod to extend PS 1.6 objects. Although I can get the field to show on the registration form, no information is inserted to the database. Turning on Dev Mode shows no errors. It looks to me like the customer controller is very different than the objects the tut is talking about.
Can anyone help me decipher where I'm going wrong in this endeavor? The steps I've taken are...
1. Created a new text field in the database, newfield.
2. Created a new file, Customers.php, in "override/classes" and put in what the tutorial implied was the correct class snippet to override.
3. Copied the "renderForm()" method from "controllers/admin/AdminCustomersController.php" to a file of the same name in "overrides/controllers/admin", modified the method to add my field info and edited the last line to read "return AdminController::renderForm();"
4. Added the field html to the authentication.tpl file in my theme
(there is more but this is all that is germane to getting the data to the database)
The field shows up in the form and registration goes through without errors but there is no data in the database.
What am I doing wrong? Where else can I go for help?
« Older What to do with half-dead crepe myrtle? | Excel Filter: IF Statements and Concatenate Newer »
This thread is closed to new comments.