// Fix #PSCFV-4525
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17632 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+7
-2
@@ -273,8 +273,13 @@ class HookCore extends ObjectModel
|
||||
if ($hook_name != 'displayPayment')
|
||||
$sql->where('h.name != "displayPayment"');
|
||||
// For payment modules, we check that they are available in the contextual country
|
||||
elseif ($frontend && 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.')');
|
||||
elseif ($frontend)
|
||||
{
|
||||
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.')');
|
||||
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 = '.(int)$context->currency->id.' LIMIT 1) = '.(int)$context->currency->id.')');
|
||||
}
|
||||
if (Validate::isLoadedObject($context->shop))
|
||||
$sql->where('hm.id_shop = '.(int)$context->shop->id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user