Wow I created the function on the controller->geo_zone.php but after running it the edit page is slow as hell.
For a one-time quick use, you may use this function to temporarily replace the "AddGeoZone" function by removing the "AddGeoZone" function and renaming the function below to "AddGeoZone" .
Add a Geo Zone as you normally would, by typing the name/decription except you don't have to add any zones below.
Once you're done, click on edit and all the countries should be in the zone. Page is going to be huge.
Restore the geo_zone.php to the original code once you're done.
Code: Select all
public function addAllCountriesToThisGeoZone($data) {
$this->db->query("INSERT INTO " . DB_PREFIX . "geo_zone SET name = '" . $this->db->escape($data['name']) . "', description = '" . $this->db->escape($data['description']) . "', date_added = NOW()");
$geo_zone_id = $this->db->getLastId();
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country");
foreach($query->rows as $value){
$this->db->query("INSERT INTO " . DB_PREFIX . "zone_to_geo_zone SET country_id = '" . (int)$value['country_id'] . "', zone_id = '0', geo_zone_id = '" .(int)$geo_zone_id . "', date_added = NOW()");
}
$this->cache->delete('geo_zone');
}