[*] FO : Redirect to address.tpl when !Address::isCountryActiveById
This commit is contained in:
1 parent
0e1898be09
commit
3f42a381a4
1 file changed
+11
-10
@@ -415,6 +415,17 @@ class ParentOrderControllerCore extends FrontController
|
|||||||
if (key($customerAddresses) != 0)
|
if (key($customerAddresses) != 0)
|
||||||
$customerAddresses = array_values($customerAddresses);
|
$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(
|
$this->context->smarty->assign(array(
|
||||||
'addresses' => $customerAddresses,
|
'addresses' => $customerAddresses,
|
||||||
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList));
|
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList));
|
||||||
@@ -465,16 +476,6 @@ 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);
|
||||||
$bad_delivery = false;
|
$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();
|
$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