:clap: for this thread and a question...
I am trying to remove the Paypal Express payment option for category 29, but so far I haven't been able to get it to work.
I have used this method to remove the money order option from other categories successfully, but the Paypal Express module is giving me trouble.
I'm thinking the added code (in red) is not in the correct place, but I don't know much about php and am unsure of where it should go. Any help is much appreciated!
Here's what I have now, in paypalwpp.php:
function update_status() {
global $order, $db;
if ($this->enabled && (int)$this->zone > 0) {
$check_flag = false;
$sql = "SELECT zone_id
FROM " . TABLE_ZONES_TO_GEO_ZONES . "
WHERE geo_zone_id = :zoneId
AND zone_country_id = :countryId
ORDER BY zone_id";
$sql = $db->bindVars($sql, ':zoneId', $this->zone, 'integer');
$sql = $db->bindVars($sql, ':countryId', $order->billing['country']['id'], 'integer');
$check = $db->Execute($sql);
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) {
$this->enabled = false;
}
global $cart;
if ($_SESSION['cart']->in_cart_check('master_categories_id','29') > 0) {
$this->enabled = false;
}
// module cannot be used for purchase > $10,000 USD
$order_amount = $this->calc_order_amount($order->info['total'], 'USD');
if ($order_amount > 10000) $this->enabled = false;
}
}