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

@@ -181,9 +181,6 @@ abstract class PaymentModuleCore extends Module
ShopUrl::resetMainDomainCache();
$id_currency = $currency_special ? (int)$currency_special : (int)$this->context->cart->id_currency;
$this->context->currency = new Currency((int)$id_currency, null, (int)$this->context->shop->id);
if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery') {
$context_country = $this->context->country;
}
$order_status = new OrderState((int)$id_order_state, (int)$this->context->language->id);
if (!Validate::isLoadedObject($order_status)) {
@@ -463,15 +460,6 @@ abstract class PaymentModuleCore extends Module
}
}
// The country can only change if the address used for the calculation is the delivery address, and if multi-shipping is activated
if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery') {
$this->context->country = $context_country;
}
if (!$this->context->country->active) {
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.');
}
if (self::DEBUG_MODE) {
PrestaShopLogger::addLog('PaymentModule::validateOrder - Payment is about to be added', 1, null, 'Cart', (int)$id_cart, true);