Post by WebDev22 » Wed May 18, 2011 3:30 am

Oh, and one of the four fields needs to be a checkbox?

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by WebDev22 » Wed May 18, 2011 2:56 pm

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?

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by ckonig » Wed May 18, 2011 3:10 pm

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.

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by WebDev22 » Wed May 18, 2011 7:56 pm

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

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by ckonig » Wed May 18, 2011 8:39 pm

Well good luck with that!

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by WebDev22 » Wed May 18, 2011 9:36 pm

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

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by ckonig » Wed May 18, 2011 10:04 pm

did you edit the models as well?
make sure that they get all data from the controller by replacing

Code: Select all

public function addCustomer($data) {
with

Code: Select all

public function addCustomer($data) {
print_r($data);die();
then try to add a customer and look if all data arrives in the model

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by WebDev22 » Wed May 18, 2011 10:21 pm

Currently, I have 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()");
Should I change it to this?

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()");

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by WebDev22 » Wed May 18, 2011 10:34 pm

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()

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by ckonig » Wed May 18, 2011 10:36 pm

Unknown column 'salon' in 'field list' means that you will have to add a field with the name salon to your customer table.

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by WebDev22 » Wed May 18, 2011 11:01 pm

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.

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by ckonig » Wed May 18, 2011 11:06 pm

admin/view/template/sale/customer_form.tpl : the customer detail view

admin/view/template/sale/customer_list.tpl : the customer list view

User avatar
Active Member

Posts

Joined
Wed Feb 16, 2011 4:26 pm
Location - Netherlands

Post by WebDev22 » Wed May 18, 2011 11:52 pm

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> 

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by WebDev22 » Thu May 19, 2011 12:30 am

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> 
Here's a screenshot of the error:
Image

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by WebDev22 » Thu May 19, 2011 1:33 am

Still no fix. Maybe stepping away from it for a couple of hours will help. If anyone has any suggestions, please let me know. Thanks.

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by SXGuy » Thu May 19, 2011 2:15 am

the error is exactly what it says it is. you havent defined the variable "salon" in the controller file associated with the view file.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by WebDev22 » Thu May 19, 2011 2:26 am

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):

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'm missing something, but can't figure out what it is.

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by WebDev22 » Thu May 19, 2011 5:03 am

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'] = '';
		}	

Active Member

Posts

Joined
Tue Apr 05, 2011 8:35 pm

Post by m3ndi3 » Thu Jun 16, 2011 5:26 pm

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!!

Newbie

Posts

Joined
Thu Jun 16, 2011 5:21 pm

Post by SVN » Fri Aug 05, 2011 2:45 pm

I encounter a problem...

Notice: Undefined variable: column_expert_id in /vqmod/vqcache/vq-admin_view_template_sale_customer_list.tpl on line 33

User avatar
SVN
Active Member

Posts

Joined
Mon Jan 03, 2011 11:59 pm
Who is online

Users browsing this forum: No registered users and 5 guests