You could try the following edit to the /include/modules/payment/paypal/tpl_ec_button.php file:
After this line,
Code:
$paypalec_enabled = (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
Insert the following new lines:
Code:
if ($paypalec_enabled) {
// check if logged-in customer's address is in an acceptable zone
if ((int)MODULE_PAYMENT_PAYPALWPP_ZONE > 0 && isset($_SESSION['customer_id']) && (int)$_SESSION['customer_id'] > 0) {
$custCountryCheck = (isset($order)) ? $order->billing['country']['id'] : $_SESSION['customer_country_id'];
$custZoneCheck = (isset($order)) ? $order->billing['zone_id'] : $_SESSION['customer_zone_id'];
$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', (int)MODULE_PAYMENT_PAYPALWPP_ZONE, 'integer');
$sql = $db->bindVars($sql, ':countryId', $custCountryCheck, 'integer');
$result = $db->Execute($sql);
while (!$result->EOF) {
if ($result->fields['zone_id'] < 1 || $result->fields['zone_id'] == $custZoneCheck) {
$check_flag = true;
break;
}
$result->MoveNext();
}
if (!$check_flag) {
$paypalec_enabled = false;
}
}
// PayPal module cannot be used for purchase > $10,000 USD
if ( ($_SESSION['cart']->total * $currencies->get_value('USD')) > 10000) {
$paypalec_enabled = false;
}
}