Binding a payment module to more than one country zone ID
Hi, Im using the eway payment module for credit card, it has an option in the admin to set it to function for one zone - or none at all.
Id like to make a small change to the file for it to work within two country zones.
If Im reading the code correctly, its checking the ‘geo zones’ against the db and deciding whether to allow the module based on what country is chosen in the admin. (and as mentioned above, the option in the admin only lets you chose one country or none at all)
Could someone please help me rewrite this to allow the module to be based on one or more zones?
PHP Code:
// class methods
function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_EWAY_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("SELECT zone_id FROM " . TABLE_ZONES_TO_GEO_ZONES . " WHERE geo_zone_id = '" . MODULE_PAYMENT_EWAY_ZONE . "' AND zone_country_id = '" . $order->billing['country']['id'] . "' ORDER BY zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->billing['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
Cheers,
Scott.
Donation made. Enjoy those donuts! :-)
Bookmarks