In that same file, a few lines lower, is a function for update_status(). Add your shipping-module check there by adding the new code shown:
Code:
function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_ZONE > 0) ) {
$check_flag = false;
$check_query = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
while (!$check_query->EOF) {
if ($check_query->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check_query->fields['zone_id'] == $order->billing['zone_id']) {
$check_flag = true;
break;
}
$check_query->MoveNext();
}
// disable for certain shipping module only:
if ($_SESSION['shipping'] == 'name_of_code_from_shipping_module') $check_flag = false;
if ($check_flag == false) {
$this->enabled = false;
}
}
}
For name_of_code_from_shipping_module check the $this->code = 'blahblah' line near the top of the shipping module file that represents the shipping module you're wanting to restrict for.
Granted, if your shipping module generates various different $_SESSION['shipping'] values depending on which offered service the customer selects, you may have to alter the logic in that "if" statement to accomodate.
Bookmarks