Post by omanincense » Wed Oct 04, 2017 5:36 pm

I wanted to create a new Geo Zones, so I went to System>Localization>Geo Zone, and then clicked on the sign "+" and entered "Geo Zone Name" and "Description". Then, i added a new countries for this particular Geo Zone. But, after saving the new list and coming back again after some time I found some countries have been removed from the new list, or deleted without any clear reason or notification from the system !!

In another word, the system remove countries from my Geo Zones by itself.

Anyone could help me in this?

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by straightlight » Wed Oct 04, 2017 6:14 pm

Which OC version are you using?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by omanincense » Thu Oct 05, 2017 12:28 am

I'm using the latest version which is 3.0.2.0. and default Geo Zones module. I have not install any additional modules or extensions.

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by straightlight » Thu Oct 05, 2017 1:02 am

Create another geo zone. When saving, see if you notice any recent log entries in your error logs.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by omanincense » Thu Oct 05, 2017 3:49 am

I have tried this solution, and i got dame result, and nothing written into the error log file.

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by straightlight » Thu Oct 05, 2017 5:20 am

Is this issue occurring with a specific language pack or the English pack as well? Do you also have extensions installed on your store?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Thu Oct 05, 2017 5:32 am

A clue.

In admin/model/localisation/geo_zone.php file, in the addGeoZone method,

find:

Code: Select all

$geo_zone_id = $this->db->getLastId();

		if (isset($data['zone_to_geo_zone'])) {
			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()");
			}
		}
replace with:

Code: Select all

$geo_zone_id = $this->db->getLastId();

		if (isset($data['zone_to_geo_zone'])) {
			foreach ($data['zone_to_geo_zone'] as $value) {
				$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()");
			}
		}

This should resolved the problem.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by omanincense » Fri Oct 06, 2017 2:56 pm

I have applied this suggested modification, and i entered 57 countries in new geo zone list. Everything looks fine and all countries are there even i did sign out and resign in again after some time. But, six hours latter, 20 countries have been removed and deleted from this new particular list !!!

Any idea?!

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by straightlight » Fri Oct 06, 2017 6:52 pm

When you look directly on your database in the geo zones table, do you still see those entries you can no longer see from the Opencart admin?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by omanincense » Fri Oct 06, 2017 8:25 pm

All the zones i have created are there in the oc_geo_zone table as well as the admin panel. But, the issue with the countries that i have added for every and each zone. The zones are there, but the countries that i created inside each zone are missing after certain time !!

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by straightlight » Fri Oct 06, 2017 9:46 pm

In your PHPMyAdmin console, select your Opencart database. Then, in the SQL tab, execute the following statement:

Code: Select all

SELECT `c`.`name` AS `country_name`, `z`.`name` AS `zone_name`, `gz`.`name` AS `geo_zone_name` FROM `oc_zone_to_geo_zone` `z2gz` INNER JOIN `oc_geo_zone` `gz` ON (`gz`.`geo_zone_id` = `z2gz`.`geo_zone_id`) INNER JOIN `oc_zone` `z` ON (`z`.`zone_id` = `z2gz`.`zone_id`) INNER JOIN `oc_country` `c` ON (`c`.`country_id` = `z2gz`.`country_id`);
Note: Change all instances of: oc_ to your real database table prefix that you currently use. Then, execute the query. From the appearing results, see if you also notice missing entries.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by omanincense » Sat Oct 07, 2017 3:22 am

This is the message is got after running the query :
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0350 seconds.)

Well, it seems working now as it should be. If anything went wrong i will update my reply O0

Thank you for your great help and support...

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by omanincense » Sun Oct 08, 2017 2:04 pm

straightlight wrote:
Fri Oct 06, 2017 9:46 pm
In your PHPMyAdmin console, select your Opencart database. Then, in the SQL tab, execute the following statement:

Code: Select all

SELECT `c`.`name` AS `country_name`, `z`.`name` AS `zone_name`, `gz`.`name` AS `geo_zone_name` FROM `oc_zone_to_geo_zone` `z2gz` INNER JOIN `oc_geo_zone` `gz` ON (`gz`.`geo_zone_id` = `z2gz`.`geo_zone_id`) INNER JOIN `oc_zone` `z` ON (`z`.`zone_id` = `z2gz`.`zone_id`) INNER JOIN `oc_country` `c` ON (`c`.`country_id` = `z2gz`.`country_id`);
Note: Change all instances of: oc_ to your real database table prefix that you currently use. Then, execute the query. From the appearing results, see if you also notice missing entries.
Hello,

I would like to thank you so much for your help and support. The issue does not occurred again and i think it has been solved.

Warm regards to you and t all members.

New member

Posts

Joined
Tue Oct 03, 2017 8:13 pm

Post by tonkp » Mon Oct 09, 2017 12:53 pm

Most of the errors found in the Opencart forum come from programming.




sbobet

Newbie

Posts

Joined
Fri Sep 08, 2017 3:41 pm
Who is online

Users browsing this forum: No registered users and 94 guests