[*] FO : Redirect to address.tpl when !Address::isCountryActiveById
This commit is contained in:
@@ -415,6 +415,17 @@ class ParentOrderControllerCore extends FrontController
|
||||
if (key($customerAddresses) != 0)
|
||||
$customerAddresses = array_values($customerAddresses);
|
||||
|
||||
if (!count($customerAddresses))
|
||||
{
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!Address::isCountryActiveById((int)$this->context->cart->id_address_delivery)) || (!Address::isCountryActiveById((int)$this->context->cart->id_address_invoice)))
|
||||
{
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'addresses' => $customerAddresses,
|
||||
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList));
|
||||
@@ -465,16 +476,6 @@ class ParentOrderControllerCore extends FrontController
|
||||
$address = new Address($this->context->cart->id_address_delivery);
|
||||
$id_zone = Address::getZoneById($address->id);
|
||||
$bad_delivery = false;
|
||||
if (($bad_delivery = (bool)!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();
|
||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
||||
|
||||
Reference in New Issue
Block a user