Page 1 of 1
Undefined index
Posted: Thu Sep 02, 2010 3:02 am
by yest
When the customer did not sign the shipping address the product instead of checking the problem suddenly appeared at the top of the page the following instruction:
Notice: Undefined index: firstname in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 313Notice: Undefined index: lastname in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 317Notice: Undefined index: address_1 in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 321Notice: Undefined index: city in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 325Notice: Undefined index: country_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 331Notice: Undefined index: country_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 339Notice: Undefined index: zone_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 343
Re: Undefined index
Posted: Thu Sep 02, 2010 10:53 am
by kedgetech
You can verify if there is a problem with language classes of address. Its a place to start atleast. I am guessing you are missing a class or something.
Re: Undefined index
Posted: Thu Sep 02, 2010 6:50 pm
by yest
i chaked it all. there is no problem with lan classes...
Re: Undefined index
Posted: Thu Sep 02, 2010 8:58 pm
by kedgetech
PM me your details(
sales@kedgegroup.com) . I will have a look at it tomo.
Re: Undefined index
Posted: Thu Sep 02, 2010 10:19 pm
by Qphoria
yest wrote:When the customer did not sign the shipping address the product instead of checking the problem suddenly appeared at the top of the page the following instruction:
Notice: Undefined index: firstname in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 313Notice: Undefined index: lastname in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 317Notice: Undefined index: address_1 in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 321Notice: Undefined index: city in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 325Notice: Undefined index: country_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 331Notice: Undefined index: country_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 339Notice: Undefined index: zone_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 343
I keep hearing about this but can never reproduce it. What are the exact steps to reproduce this?
Re: Undefined index
Posted: Fri Oct 01, 2010 12:35 am
by ziomiki
yest wrote:When the customer did not sign the shipping address the product instead of checking the problem suddenly appeared at the top of the page the following instruction:
Notice: Undefined index: firstname in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 313Notice: Undefined index: lastname in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 317Notice: Undefined index: address_1 in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 321Notice: Undefined index: city in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 325Notice: Undefined index: country_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 331Notice: Undefined index: country_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 339Notice: Undefined index: zone_id in /home/wpstore/public_html/catalog/controller/checkout/address.php on line 343
Same problem.
1: register a new customer, go to home page.
2:I choose a product and put it in the cart, then i go to checkout and OC asks me to choose the existing address (written during registration) or specify a new address for the shipping. In this page, if i don't select the existing address and i don't compile the new fields and the press the button "continue" (related of existing address) the problem appear. the page is: index.php?route=checkout/address/shipping.
The problem is caused because none of the addresses entered by the customer during the registration or insereted in the profile is selected ad default choiche. A simple way is select the first address.
Any solution?
Thanks!
OC 1.4.9.1
Re: Undefined index
Posted: Fri Oct 01, 2010 9:24 am
by Qphoria
This is an issue that I've seen too.. not sure why it isn't mapping the default address. so that is one bug
and the other bug would be clicking next without choosing the radio button gives the errors. I'm looking at it
Re: Undefined index
Posted: Fri Oct 01, 2010 10:07 pm
by ziomiki
update: i have seen that the problem is caused because the address is not stored as default address, but if i select one of the addresses, put the option box in YES as default and save; when i go back see the option....it is setted in NO.
i think there's a problem with the funcition that store the addresses and relative options.
With a new plain vanilla local installation there are no problem with address index after 2h testing.
Re: Undefined index
Posted: Mon Oct 04, 2010 1:54 pm
by alltrade
I'm having the same issue. Was this ever solved?
Re: Undefined index
Posted: Mon Oct 04, 2010 2:11 pm
by tonychen
Forgive my English...
I know where is the problem is.
The problem happens when You update the customer address list in the backend.
The update deleted the address list and then insert the data, thus the address_id in the address table changed(auto increment), but the address_id in the customer table did NOT change to the new address_id in the address table as it should.
I hope You can understand my explanation, and hope some one can fix the bug...
Thanks,
Tony Chen
Re: Undefined index
Posted: Tue Oct 05, 2010 11:36 pm
by ziomiki
good kill tonychen!!!
The address id don't change in the customer table...so, for now, we can manually modify the id in DB because this problem there is only in the backend. The administrator know the details of the customer that need some mod, so he can find the id of new address in the address table and put it in the customer table.
Thanks! And hope in a quickly fix!
Re: Undefined index
Posted: Wed Oct 06, 2010 1:56 am
by Qphoria
Good find tonychen... and unfortunately this one is a pain to fix. I'll post up a solution when I figure one out
Re: Undefined index
Posted: Thu Oct 07, 2010 10:06 am
by tonychen
I have a quick solution for this problem...
It is not perfect , but it solve the problem anyway(you won't get customer calling for service).
Solution:
in "admin/model/sale/customer.php"
1. find
public function editCustomer($customer_id, $data) {
$this->db->query("UPDATE " . 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']) . "', cellphone = '" . $this->db->escape($data['cellphone']) . "', fax = '" . $this->db->escape($data['fax']) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', status = '" . (int)$data['status'] . "' WHERE customer_id = '" . (int)$customer_id . "'");
if ($data['password']) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET password = '" . $this->db->escape(md5($data['password'])) . "' WHERE customer_id = '" . (int)$customer_id . "'");
}
$this->db->query("DELETE FROM " . DB_PREFIX . "address WHERE customer_id = '" . (int)$customer_id . "'");
if (isset($data['addresses'])) {
foreach ($data['addresses'] as $address) {
$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($address['firstname']) . "', lastname = '" . $this->db->escape($address['lastname']) . "', company = '" . $this->db->escape($address['company']) . "', taxid = '" . $this->db->escape($address['taxid']) . "', address_1 = '" . $this->db->escape($address['address_1']) . "', address_2 = '" . $this->db->escape($address['address_2']) . "', city = '" . $this->db->escape($address['city']) . "', postcode = '" . $this->db->escape($address['postcode']) . "', country_id = '" . (int)$address['country_id'] . "', zone_id = '" . (int)$address['zone_id'] . "'");
}
}
2. add the following lines right after:
//
$address_id = $this->db->getLastId();
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int)$address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");
//
}
That's it.
When the customer has only one shipping address, there is no problem with it.
When the customer has more than one shipping address, and you might change his default shipping address after you update his customer info in the backend. But I think this is a minor problem, at least he has a chance to choose the right shipping address while he is doing chekout. Anyway, the checkout process will be going smoothly, Right?
I am still waiting that Qphoria can give us a perfect solution for this problem.
Re: Undefined index
Posted: Mon Oct 11, 2010 12:46 am
by yest
It does not work ... I did a test and it does not matter how many addresses have a customer ... It does not work even when one address ..
Re: Undefined index
Posted: Thu Apr 21, 2011 7:16 am
by yiyinlah
Did somebody solve it??
I'm using 1.4.9.4.
I have the same errors, don't know what to do

Re: Undefined index
Posted: Thu Apr 21, 2011 8:04 am
by Qphoria
This was fixed back in 1.4.9.1
Re: Undefined index
Posted: Thu Apr 21, 2011 8:08 am
by yiyinlah
But I just upgrade the cart to 1.4.9.4 yesterday, and I'm still in the midst of setting up my store, so I'm still testing out.
I received this error just few hours ago, what should I do?

Re: Undefined index
Posted: Thu Apr 21, 2011 8:15 am
by Qphoria
You sure its the same error? Undefined index is a generic term for many errors. the actual error here is:
Notice: Undefined index: firstname
Re: Undefined index
Posted: Thu Apr 21, 2011 8:37 am
by yiyinlah
This is the error I'm getting.
I'm 100% sure it's the same error.
This is my error message:
Code: Select all
Notice: Undefined index: firstname in /home/username/public_html/catalog/controller/checkout/address.php on line 313Notice: Undefined index: lastname in /home/username/public_html/catalog/controller/checkout/address.php on line 317Notice: Undefined index: address_1 in /home/username/public_html/catalog/controller/checkout/address.php on line 321Notice: Undefined index: city in /home/username/public_html/catalog/controller/checkout/address.php on line 325Notice: Undefined index: country_id in /home/username/public_html/catalog/controller/checkout/address.php on line 331Notice: Undefined index: country_id in /home/username/public_html/catalog/controller/checkout/address.php on line 339Notice: Undefined index: zone_id in /home/username/public_html/catalog/controller/checkout/address.php on line 343
It happened when I was trying out Paypal, & click cancel & return to my store.
If I didn't remembered wrongly, cos I was playing around with OC.