I've spent most of the day bypassing the vQmod option and trying to customize each individual file to accommodate the new section and fields for registration. Since I don't work with databases all that much, it appears I'm in over my head, so I might return to trying to get this XML approach to work.
Has anyone used this approach to create a new section on the registration page with three text fields and one checkbox?
Has anyone used this approach to create a new section on the registration page with three text fields and one checkbox?
Well I use this script to realize 2 different fields, by having two instances of this script, each one for its own field. So you could just use it three times for the text fields, and modify the fourth one to have a checkbox value. But will anyway need to have database fields prepared, so the information can be stored. But that should be easily done with PHPmyAdmin.
For having an actual separated section, it would be more handy to modify the one script to hold all four values.
For having an actual separated section, it would be more handy to modify the one script to hold all four values.
The team is insistent about having its own section, so I'm going to attempt setting this up without vQmod. I don't see any other way. This means having to go through each of the following files and modifying them accordingly:
admin/view/template/sale/customer_list.tpl
admin/view/template/sale/customer_form.tpl
admin/language/english/sale/customer.php
admin/model/sale/customer.php
admin/controller/sale/customer.php
system/library/customer.php
catalog/view/theme/default/template/account/edit.tpl
catalog/language/english/account/edit.php
catalog/controller/account/create.php
catalog/controller/account/edit.php
catalog/model/account/customer.php
admin/view/template/sale/customer_list.tpl
admin/view/template/sale/customer_form.tpl
admin/language/english/sale/customer.php
admin/model/sale/customer.php
admin/controller/sale/customer.php
system/library/customer.php
catalog/view/theme/default/template/account/edit.tpl
catalog/language/english/account/edit.php
catalog/controller/account/create.php
catalog/controller/account/edit.php
catalog/model/account/customer.php
I've got the front end built out and most of the back end as well, but cannot figure out why the data for the three new fields isn't being added to the database.
https://www.tanningbedlotionsdirect.com ... unt/create
https://www.tanningbedlotionsdirect.com ... unt/create
did you edit the models as well?
make sure that they get all data from the controller by replacing
with
then try to add a customer and look if all data arrives in the model
make sure that they get all data from the controller by replacing
Code: Select all
public function addCustomer($data) {
Code: Select all
public function addCustomer($data) {
print_r($data);die();
Currently, I have this:
Should I change it to this?
Code: Select all
class ModelSaleCustomer extends Model {
public function addCustomer($data) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', salon = '" . $this->db->escape($data['salon']) . "', bed_model = '" . $this->db->escape($data['bed_model']) . "', bed_year = '" . $this->db->escape($data['bed_year']) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', password = '" . $this->db->escape(md5($data['password'])) . "', status = '" . (int)$data['status'] . "', date_added = NOW()");
Code: Select all
class ModelSaleCustomer extends Model {
public function addCustomer($data) {
print_r($data);die();
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', salon = '" . $this->db->escape($data['salon']) . "', bed_model = '" . $this->db->escape($data['bed_model']) . "', bed_year = '" . $this->db->escape($data['bed_year']) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', password = '" . $this->db->escape(md5($data['password'])) . "', status = '" . (int)$data['status'] . "', date_added = NOW()");
I keep getting this error and cannot figure out what I'm missing. For testing purposes, I changed the order in the SQL statement in catalog/model/account/customer.php, putting 'salon' second in line of the three new fields, and still get the same error:
Error: Unknown column 'salon' in 'field list'
Error No: 1054
INSERT INTO customer SET store_id = '0', firstname = 'John', lastname = 'Smith', email = 'johnsmith@tanningbedlotionsdirect.com', telephone = '770-555-5222', fax = '', salon = 'Acme Tanning', bed_model = 'Sunquest 24RS', bed_year = '2009', password = '070a66ab11415580790aa304b23bfb3e', newsletter = '0', customer_group_id = '8', status = '1', date_added = NOW()
Error: Unknown column 'salon' in 'field list'
Error No: 1054
INSERT INTO customer SET store_id = '0', firstname = 'John', lastname = 'Smith', email = 'johnsmith@tanningbedlotionsdirect.com', telephone = '770-555-5222', fax = '', salon = 'Acme Tanning', bed_model = 'Sunquest 24RS', bed_year = '2009', password = '070a66ab11415580790aa304b23bfb3e', newsletter = '0', customer_group_id = '8', status = '1', date_added = NOW()
I forgot that I had changed naming conventions. I had 'salon_name' in the database originally, but had coded everything as 'salon'. So, now there are no errors and everything shows up properly in the database. I now need to get this information to appear in Admin under Sales > Customers. It doesn't have to appear on the main page. It's okay if it requires clicking "Edit" to view the information. Let me know if you know where to locate that.
I added the following to customer_form.tpl, but get an error that reads: <b>Notice</b>: Undefined variable: salon in <b>/home/charley/public_html/admin/view/template/sale/customer_form.tpl</b> on line <b>108</b>. Any idea what I'm missing?
Code: Select all
<tr>
<td><?php echo $entry_salon; ?></td>
<td><input type="text" name="salon" value="<?php echo $salon; ?>" /></td>
</tr>
Here's a screenshot of the error:WebDev22 wrote:I added the following to customer_form.tpl, but get an error that reads: <b>Notice</b>: Undefined variable: salon in <b>/home/charley/public_html/admin/view/template/sale/customer_form.tpl</b> on line <b>108</b>. Any idea what I'm missing?
Code: Select all
<tr> <td><?php echo $entry_salon; ?></td> <td><input type="text" name="salon" value="<?php echo $salon; ?>" /></td> </tr>

I used the Fax variable as an example and added the bottom three rows below to catalog/controller/account/edit.php (Added Lines 55-57):
I'm missing something, but can't figure out what it is.
Code: Select all
$this->data['entry_firstname'] = $this->language->get('entry_firstname');
$this->data['entry_lastname'] = $this->language->get('entry_lastname');
$this->data['entry_email'] = $this->language->get('entry_email');
$this->data['entry_telephone'] = $this->language->get('entry_telephone');
$this->data['entry_fax'] = $this->language->get('entry_fax');
$this->data['entry_salon'] = $this->language->get('entry_salon');
$this->data['entry_bed_model'] = $this->language->get('entry_bed_model');
$this->data['entry_bed_year'] = $this->language->get('entry_bed_year');
I figured it out. In the catalog/controller/accout/edit.php file, I had left these out:
Code: Select all
if (isset($this->request->post['salon'])) {
$this->data['salon'] = $this->request->post['salon'];
} elseif (isset($customer_info)) {
$this->data['salon'] = $customer_info['salon'];
} else {
$this->data['salon'] = '';
}
Help! I have the upgraded Version 1.5 and there are no account/create.php files! Instead there are account/register.php files... I tried to just replace all create with register... but the vQmod didn't work... Can someone please update XML to work with new update?? Thank you!!
Who is online
Users browsing this forum: No registered users and 5 guests