Jump to content

Added field to registration but value inserted is null with undefined variable error


Recommended Posts

Hi,
 
I've just begun working with Prestashop 1.6 and I'm impressed.  Thank you!
 
I'm trying to add a new unrequired field to the registration form, "certagency", using this tutorial for 1.5 (couldn't find one for 1.6, my version).  The tutorial had some slight differences in line numbers but otherwise it was the same, and I followed the update at the end, too.
 
My problem is when I register with the new field, everything seems to be good (in regular mode) but there is no info in the database for the new field.  I tracked down the query from MySQL logs and the field is being sent via the query but with either NULL or blank data, depending on whether I set the field in MySQL to allow NULL values or not.  I've tried both varchar and text.
 
I set PS_MODE_DEV_ to true in defines.inc.php and now I get an error when I register: Undefined variable: certagency in /var/www/mystoredomain.com/controllers/front/AuthController.php on line 434. 

 

Line 434 is:

$customer->certagency = $certagency;

from step 3 of the linked tutorial. I've quadruple checked for errors but the instructions were followed properly.

 

Can anyone help me?  I don't know where to go from here, as people say that tutorial worked fine for them.  Is 1.6 that different from 1.5?  I am really wanting to understand the structure and logic of PS which is why I'm not simply buying a module for this.  Thanks!!

Edited by gumbotron (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...