Remove address as required in booking/order flow

This commit is contained in:
Shreesh Arora
2023-11-20 16:01:54 +05:30
parent ce93a9826f
commit 7b938aa023
8 changed files with 52 additions and 86 deletions

View File

@@ -2065,8 +2065,8 @@ abstract class ModuleCore
public static function getPaymentModules()
{
$context = Context::getContext();
if (isset($context->cart)) {
$billing = new Address((int)$context->cart->id_address_invoice);
if (Validate::isLoadedObject($context->country)) {
$id_country = (int)$context->country->id;
}
$use_groups = Group::isFeatureActive();
@@ -2097,7 +2097,7 @@ abstract class ModuleCore
LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module`
LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook`
WHERE h.`name` = \''.pSQL($hook_payment).'\'
'.(isset($billing) && $frontend ? 'AND mc.id_country = '.(int)$billing->id_country : '').'
'.(isset($id_country) && $frontend ? 'AND mc.id_country = '.(int)$id_country : '').'
AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).'
AND hm.id_shop IN('.implode(', ', $list).')
'.((count($groups) && $frontend && $use_groups) ? 'AND (mg.`id_group` IN ('.implode(', ', $groups).'))' : '').'