Post by pla1829 » Thu Dec 08, 2016 2:25 pm

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...?

New member

Posts

Joined
Sat Nov 22, 2014 12:16 pm

Post by paulfeakins » Thu Dec 08, 2016 8:57 pm

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


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by pla1829 » Fri Dec 09, 2016 12:01 am

Yes, I did match the vqmod errors with a vqmod. Thank you as I have contacted the developer.

Also, any idea about the geo_zone.php errors?

New member

Posts

Joined
Sat Nov 22, 2014 12:16 pm

Post by opencartmart » Fri Dec 09, 2016 12:46 am

pla1829 wrote:Also, any idea about the geo_zone.php errors?
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.

Code: Select all

foreach ($data['zone_to_geo_zone'] as $value) {
Add following line after above line:

Code: Select all

if (!isset($value['zone_id'])) continue;
Since artcore has complained this solution is almost same as his solution mentioned in another question. So this piece of codes should only belongs to him! Respect!

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']);
			});
Solution 3:

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

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


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by artcore » Fri Dec 09, 2016 2:20 am

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

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by pla1829 » Fri Dec 09, 2016 3:56 am

Thank you for your help. It is much appreciated. I will post back if any other errors post..

New member

Posts

Joined
Sat Nov 22, 2014 12:16 pm

Post by opencartmart » Fri Dec 09, 2016 2:50 pm

artcore 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.
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 solutions

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 11 guests