I am running OpenCart 2.3.0.2 and getting the following errors for the following file: /admin/model/localisation/geo_zone.php
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 28
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 30
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 10
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 12
ALSO getting some more errors
Undefined index: query in [route]/vqmod/vqcache/vq2-system_library_pagination.php on line 43Notice: Undefined index: host in [route]/vqmod/vqcache/vq2-system_library_pagination.php on line 45
What can I do to correct the errors...?
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 28
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 30
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 10
PHP Notice: Undefined index: zone_id in [route]/admin/model/localisation/geo_zone.php on line 12
ALSO getting some more errors
Undefined index: query in [route]/vqmod/vqcache/vq2-system_library_pagination.php on line 43Notice: Undefined index: host in [route]/vqmod/vqcache/vq2-system_library_pagination.php on line 45
What can I do to correct the errors...?
It sounds like this could be caused by one of your vQmods. Try disabling them 1 by 1 until the error goes away and then ask the developer of that extension to fix.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Legendary Member
This error should not be there actually but interestingly I saw few issues related with it recent days. Just quick solution. Find following line, you will get two times.pla1829 wrote:Also, any idea about the geo_zone.php errors?
Code: Select all
foreach ($data['zone_to_geo_zone'] as $value) {
Code: Select all
if (!isset($value['zone_id'])) continue;
So I am giving two more alternative solutions:
Solution 2:
Insert following codes before the line foreach ($data['zone_to_geo_zone'] as $value) {
Code: Select all
$data['zone_to_geo_zone'] = array_filter($data['zone_to_geo_zone'], function($value) {
return isset($value['zone_id']) && isset($value['country_id']);
});
Replace following codes
Code: Select all
foreach ($data['zone_to_geo_zone'] as $value) {
$this->db->query("DELETE FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$geo_zone_id . "' AND country_id = '" . (int)$value['country_id'] . "' AND zone_id = '" . (int)$value['zone_id'] . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "zone_to_geo_zone SET country_id = '" . (int)$value['country_id'] . "', zone_id = '" . (int)$value['zone_id'] . "', geo_zone_id = '" . (int)$geo_zone_id . "', date_added = NOW()");
}
Code: Select all
foreach ($data['zone_to_geo_zone'] as $value) {
if (isset($value['zone_id'])) {
$this->db->query("DELETE FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$geo_zone_id . "' AND country_id = '" . (int)$value['country_id'] . "' AND zone_id = '" . (int)$value['zone_id'] . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "zone_to_geo_zone SET country_id = '" . (int)$value['country_id'] . "', zone_id = '" . (int)$value['zone_id'] . "', geo_zone_id = '" . (int)$geo_zone_id . "', date_added = NOW()");
}
}
Last edited by opencartmart on Fri Dec 09, 2016 2:58 pm, edited 1 time in total.
XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart
It's proper netiquette to refer to the original post where you found a fix in order to keep information in one spot and keep credit where it belongs. Please respect the valuable time someone else spent to search for a solution.
viewtopic.php?f=190&t=162583#p649130
viewtopic.php?f=190&t=162583#p649130
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Very funny! Do you think , I have to learn this single piece of code from you? I know you have always in too much coffee. Anyway I am not going to reply on this thread anymore whatever your reply. Also I added two more alternative solutionsartcore wrote:It's proper netiquette to refer to the original post where you found a fix in order to keep information in one spot and keep credit where it belongs. Please respect the valuable time someone else spent to search for a solution.
XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart
Who is online
Users browsing this forum: No registered users and 11 guests