So - here's a good one.
Since the CC module really should not be used, we now strictly use Authorize.net and PayPal for all credit/debit transactions. AVS gets in the way sometimes and to have the old feature of the CC Module in our back pocket would be nice.
I would like to set it up so that if a certain product is in the cart, the CC module is triggered. (I'd set a product up for example "add this to your cart for special credit card processing")
Here's the existing code:
/**
* calculate zone matches and flag settings to determine whether this module should display to customers or not
*
*/
function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_CC_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_CC_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;
}
}
}
I would assume if ($check->fields['zone_id'] < 1) { should be the check->cart['product_id, but I'm a little clouded on the rest as far as the code triggered from the cart/product.
POSSIBLE?!![]()


Reply With Quote
