From 1aa13cf7de0519aedd0a6d4235ae86e62c0b31d6 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Thu, 12 Oct 2023 20:56:13 +0530 Subject: [PATCH] Fixed: Exception while order crteation when country sent from API is not active in QloApps --- classes/PaymentModule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 3e89319f2..c16cdcb9b 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -277,7 +277,7 @@ abstract class PaymentModuleCore extends Module if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery') { $address = new Address((int)$id_address); $this->context->country = new Country((int)$address->id_country, (int)$this->context->cart->id_lang); - if (!$this->context->country->active) { + if (!$this->context->country->active && $this->name != 'wsorder') { throw new PrestaShopException('The delivery address country is not active.'); } } @@ -468,7 +468,7 @@ abstract class PaymentModuleCore extends Module $this->context->country = $context_country; } - if (!$this->context->country->active) { + if (!$this->context->country->active && $this->name != 'wsorder') { PrestaShopLogger::addLog('PaymentModule::validateOrder - Country is not active', 3, null, 'Cart', (int)$id_cart, true); throw new PrestaShopException('The order address country is not active.'); }