[-] FO - fixed bug #PSCFV-8612 - Payment module: Bug in country restriction in multi store

This commit is contained in:
vAugagneur
2013-04-09 14:59:15 +02:00
parent 0da80258d4
commit 648da86eac

View File

@@ -276,7 +276,7 @@ class HookCore extends ObjectModel
{
$sql->where(Module::getPaypalIgnore());
if (Validate::isLoadedObject($context->country))
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')');
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' AND id_shop = '.(int)$context->shop->id.' LIMIT 1) = '.(int)$context->country->id.')');
if (Validate::isLoadedObject($context->currency))
$sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -2) LIMIT 1) IN ('.(int)$context->currency->id.', -2))');
}