Fixed: Exception while order crteation when country sent from API is not active in QloApps

This commit is contained in:
Sumit Panwar
2023-10-12 20:56:13 +05:30
parent ce93a9826f
commit 1aa13cf7de

View File

@@ -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.');
}