Post by nicklas » Wed Mar 15, 2017 7:22 pm

Hi!

I've been removing zones since they are irrelevant in Sweden. Now when I removed some I got into some issues since some modules/extensions use these. For example bank_transfer uses a SQL query for zones and some others as well. As of right now I get the following error:

Code: Select all

Notice: Undefined index: zone_id in /www/xxx/xx/XXXXXX/xxxxx.se/public_html/catalog/model/extension/payment/bank_transfer.php on line 6Notice: Undefined index: zone_id in /www/xxx/xx/XXXXXX/xxxxx.se/public_html/catalog/model/payment/factoring.php on line 48Notice: Undefined index: zone_id in //www/xxx/xx/XXXXXX/xxxxx.se/public_html/catalog/model/payment/payex.php on line 48
If we start with bank_transfer.php the "problem" is:

Code: Select all

		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('bank_transfer_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");

		if ($this->config->get('bank_transfer_total') > 0 && $this->config->get('bank_transfer_total') > $total) {
			$status = false;
		} elseif (!$this->config->get('bank_transfer_geo_zone_id')) {
			$status = true;
		} elseif ($query->num_rows) {
			$status = true;
		} else {
			$status = false;
How can I edit it to not query the db for zones?
Also I got some of that in other modules but I've not yet been able to start working with those.

Thank in advance

/ Nicklas

New member

Posts

Joined
Wed Mar 15, 2017 7:14 pm

Post by thekrotek » Wed Mar 15, 2017 11:15 pm

Replace the whole code with this:

$status = true;

Or comment the code and put the same line above or below it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by nicklas » Thu Mar 16, 2017 5:23 am

Worked like a charm to replace the query line with your suggestion! Huge thank to you, really appreciated :)

New member

Posts

Joined
Wed Mar 15, 2017 7:14 pm
Who is online

Users browsing this forum: Bing [Bot] and 20 guests