Jump to content

gumbotron

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Activity
    Other

gumbotron's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok, I see what happened. I guess I assumed the Customers and Products class definitions were different (based on a misreading of the tutorial), so I was going to the Customers.php, searching for __construct() and using that function (the only __construct() function in Customers.php) for the override. When I use the same __construct() function as in your tutorial, everything works fine. Thank you, Nemo!
  2. Hi, I am still trying to add one simple field to the customer registration form in PS 1.6. I'm following Nemo's great tutorials here, using the "Adding extra fields to other Object types" section, but when I finish and try to register using the new field, it is not inserted into the database. Dev Mode shows no errors. What I've done so far is: created a new database text field "newfield" created a new file, Customers.php, in "override/classes" with the following code: Class Customer extends CustomerCore { public $newfield; public function __construct($id = null) { $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); parent::__construct($id); } } copied the "renderForm()" method from "controllers/admin/AdminCustomersController.php" to "override/controllers/admin/AdminCustomersController.php", changed the last line to "return AdminController::renderForm();" and added this to the copied array list: array( 'type' => 'text', 'label' => $this->l('Our new field:'), 'name' => 'newfield', 'size' => 64 ), I then added the html for the newfield to the authentication.tpl file in my theme. The field shows up in the registration form, but when I sign up, there is only NULL in the database for that new field. Please help?
  3. Nemo, Wow, your site is a trove of amazing PrestaShop knowledge! Thank you so much.
  4. Thanks, Nemo! I'll give it a go. I think I found your site early on in my research but it must have gotten lost in the shuffle.
  5. 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!!
×
×
  • Create New...