In another word, the system remove countries from my Geo Zones by itself.
Anyone could help me in this?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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()");
}
}
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
Any idea?!
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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`);
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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
Thank you for your great help and support...
Hello,straightlight wrote: ↑Fri Oct 06, 2017 9:46 pmIn your PHPMyAdmin console, select your Opencart database. Then, in the SQL tab, execute the following statement:
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.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`);
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.
Users browsing this forum: No registered users and 123 guests