New customer registration Bug?
Posted: Thu Mar 31, 2011 10:51 pm
Since I've seen similar posts listed as bugs, this is probably one, too. Certainly, mods, feel free to move or kill if posted in the wrong area.
OpenCart 1.4.9.3
I'm to the point where I'm testing my cart through the new customer registration mode, and then try some test orders to make sure all is working properly.
However, when I try to create a dummy new customer registration account, I receive this error:
Notice: Undefined index: telephone in /home/sabine1/public_html/catalog/model/account/customer.php on line 13Notice: Undefined index: fax in /home/sabine1/public_html/catalog/model/account/customer.php on line 13Warning: Cannot modify header information - headers already sent by (output started at /home/sabine1/public_html/index.php:94) in /home/sabine1/public_html/system/engine/controller.php on line 27
When I follow (through CPanel), the code stream, I do see where line 13 does ask for telephone and fax info, but I'm at a loss as to what to do. Although most of the dummy account is created and seems ok, I'm afraid once a potential customer sees this error message, he/she may simply quit trying to shop.
Any ideas as to how to remedy this is appreciated.
If it helps, here's copy from /home/mysite/public_html/catalog/model/account/customer/.php:
<?php
class ModelAccountCustomer extends Model {
public function addCustomer($data) {
$data['firstname'] = ucwords(strtolower(trim($data['firstname'])));
$data['lastname'] = ucwords(strtolower(trim($data['lastname'])));
$data['company'] = ucwords(strtolower(trim($data['company'])));
$data['address_1'] = ucwords(strtolower(trim($data['address_1'])));
$data['address_2'] = ucwords(strtolower(trim($data['address_2'])));
$data['city'] = ucwords(strtolower(trim($data['city'])));
$data['postcode'] = strtoupper(trim($data['postcode']));
BEGIN LINE 13
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int)$this->config->get('config_store_id') . "', 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']) . "', password = '" . $this->db->escape(md5($data['password'])) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "', status = '1', date_added = NOW()");
END LINE 13
$customer_id = $this->db->getLastId();
$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "'");
$address_id = $this->db->getLastId();
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int)$address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");
if (!$this->config->get('config_customer_approval')) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET approved = '1' WHERE customer_id = '" . (int)$customer_id . "'");
}
}
public function editCustomer($data) {
$data['firstname'] = ucwords(strtolower(trim($data['firstname'])));
$data['lastname'] = ucwords(strtolower(trim($data['lastname'])));
************************************************
Thanks, sabine1
OpenCart 1.4.9.3
I'm to the point where I'm testing my cart through the new customer registration mode, and then try some test orders to make sure all is working properly.
However, when I try to create a dummy new customer registration account, I receive this error:
Notice: Undefined index: telephone in /home/sabine1/public_html/catalog/model/account/customer.php on line 13Notice: Undefined index: fax in /home/sabine1/public_html/catalog/model/account/customer.php on line 13Warning: Cannot modify header information - headers already sent by (output started at /home/sabine1/public_html/index.php:94) in /home/sabine1/public_html/system/engine/controller.php on line 27
When I follow (through CPanel), the code stream, I do see where line 13 does ask for telephone and fax info, but I'm at a loss as to what to do. Although most of the dummy account is created and seems ok, I'm afraid once a potential customer sees this error message, he/she may simply quit trying to shop.
Any ideas as to how to remedy this is appreciated.
If it helps, here's copy from /home/mysite/public_html/catalog/model/account/customer/.php:
<?php
class ModelAccountCustomer extends Model {
public function addCustomer($data) {
$data['firstname'] = ucwords(strtolower(trim($data['firstname'])));
$data['lastname'] = ucwords(strtolower(trim($data['lastname'])));
$data['company'] = ucwords(strtolower(trim($data['company'])));
$data['address_1'] = ucwords(strtolower(trim($data['address_1'])));
$data['address_2'] = ucwords(strtolower(trim($data['address_2'])));
$data['city'] = ucwords(strtolower(trim($data['city'])));
$data['postcode'] = strtoupper(trim($data['postcode']));
BEGIN LINE 13
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int)$this->config->get('config_store_id') . "', 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']) . "', password = '" . $this->db->escape(md5($data['password'])) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "', status = '1', date_added = NOW()");
END LINE 13
$customer_id = $this->db->getLastId();
$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "'");
$address_id = $this->db->getLastId();
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int)$address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");
if (!$this->config->get('config_customer_approval')) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET approved = '1' WHERE customer_id = '" . (int)$customer_id . "'");
}
}
public function editCustomer($data) {
$data['firstname'] = ucwords(strtolower(trim($data['firstname'])));
$data['lastname'] = ucwords(strtolower(trim($data['lastname'])));
************************************************
Thanks, sabine1