[-] Fo : Fix bug #PSCFV-10640, redirect loop when country address is not among active countries in OPC
This commit is contained in:
@@ -464,8 +464,17 @@ class ParentOrderControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
$address = new Address($this->context->cart->id_address_delivery);
|
$address = new Address($this->context->cart->id_address_delivery);
|
||||||
$id_zone = Address::getZoneById($address->id);
|
$id_zone = Address::getZoneById($address->id);
|
||||||
if (!Address::isCountryActiveById((int)($this->context->cart->id_address_delivery)) || !Address::isCountryActiveById((int)($this->context->cart->id_address_invoice)))
|
$bad_delivery = false;
|
||||||
Tools::redirect('index.php?controller=order&step=1');
|
if ($bad_delivery = !Address::isCountryActiveById((int)$this->context->cart->id_address_delivery) || !Address::isCountryActiveById((int)$this->context->cart->id_address_invoice))
|
||||||
|
{
|
||||||
|
if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1 && Dispatcher::getInstance()->getController() != 'order-opc')
|
||||||
|
{
|
||||||
|
$back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, array('step' => Tools::getValue('step'), 'multi-shipping' => (int)Tools::getValue('multi-shipping')));
|
||||||
|
$params = array('multi-shipping' => (int)Tools::getValue('multi-shipping'), 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice), 'back' => $back_url);
|
||||||
|
Tools::redirect($this->context->link->getPageLink('address', true, (int)$this->context->language->id, $params));
|
||||||
|
}
|
||||||
|
Tools::redirect('index.php?controller=order&step=1');
|
||||||
|
}
|
||||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||||
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
||||||
|
|||||||
Reference in New Issue
Block a user