diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index a0aa804496f88..e17e11e5c8893 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -1310,4 +1310,4 @@ protected function getColorsListCacheId($id_product) { return Product::getColorsListCacheId($id_product); } -} +} \ No newline at end of file diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 70ce2645dc7ad..770421f0bd960 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -248,7 +248,6 @@ public function postProcess() */ protected function processSubmitLogin() { - Hook::exec('actionBeforeAuthentication'); $passwd = trim(Tools::getValue('passwd')); $email = trim(Tools::getValue('email')); @@ -459,7 +458,7 @@ protected function processSubmitAccount() Tools::redirect(html_entity_decode($back)); // redirection: if cart is not empty : redirection to the cart if (count($this->context->cart->getProducts(true)) > 0) - Tools::redirect('index.php?controller=order&multi-shipping='.(int)Tools::getValue('multi-shipping')); + Tools::redirect('index.php?controller=order'.($multi = (int)Tools::getValue('multi-shipping') ? '&multi-shipping='.$multi : '')); // else : redirection to the account else Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? urlencode($this->authRedirection) : 'my-account')); @@ -621,7 +620,7 @@ protected function processSubmitAccount() // redirection: if cart is not empty : redirection to the cart if (count($this->context->cart->getProducts(true)) > 0) - Tools::redirect('index.php?controller=order&multi-shipping='.(int)Tools::getValue('multi-shipping')); + Tools::redirect('index.php?controller=order'.($multi = (int)Tools::getValue('multi-shipping') ? '&multi-shipping='.$multi : '')); // else : redirection to the account else Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? urlencode($this->authRedirection) : 'my-account')); @@ -719,4 +718,4 @@ protected function sendConfirmationMail(Customer $customer) $customer->firstname.' '.$customer->lastname ); } -} +} \ No newline at end of file diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php index 337b81293f899..4f4af50168fdc 100644 --- a/controllers/front/OrderController.php +++ b/controllers/front/OrderController.php @@ -64,8 +64,19 @@ public function init() } if (!$this->context->customer->isLogged(true) && in_array($this->step, array(1, 2, 3))) { - $back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, array('step' => $this->step, 'multi-shipping' => (int)Tools::getValue('multi-shipping'))); - $params = array('multi-shipping' => (int)Tools::getValue('multi-shipping'), 'display_guest_checkout' => (int)Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'back' => $back_url); + + $params = array(); + if ($this->step) + $params['step'] = (int)$this->step; + if ($multi = (int)Tools::getValue('multi-shipping')) + $params['multi-shipping'] = $multi; + $back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, $params); + + $params = array('back' => $back_url); + if ($multi) + $params['multi-shipping'] = $multi; + if ($guest = (int)Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) + $params['display_guest_checkout'] = $guest; Tools::redirect($this->context->link->getPageLink('authentication', true, (int)$this->context->language->id, $params)); } @@ -405,4 +416,4 @@ public function setMedia() if ($this->step == 2) $this->addJS(_THEME_JS_DIR_.'order-carrier.js'); } -} +} \ No newline at end of file diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php index b4085812dcf0e..c6022ddec2265 100644 --- a/controllers/front/ParentOrderController.php +++ b/controllers/front/ParentOrderController.php @@ -392,7 +392,7 @@ protected function _assignAddress() Tools::redirect(''); } else if (!Customer::getAddressesTotalById($this->context->customer->id)) - Tools::redirect('index.php?controller=address&back='.urlencode('order.php?step=1&multi-shipping='.(int)Tools::getValue('multi-shipping'))); + Tools::redirect('index.php?controller=address&back='.urlencode('order.php?step=1'.($multi = (int)Tools::getValue('multi-shipping') ? '&multi-shipping='.$multi : ''))); $customer = $this->context->customer; if (Validate::isLoadedObject($customer)) { @@ -423,8 +423,17 @@ protected function _assignAddress() $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); + $params = array(); + if ($this->step) + $params['step'] = (int)$this->step; + if ($multi = (int)Tools::getValue('multi-shipping')) + $params['multi-shipping'] = $multi; + $back_url = $this->context->link->getPageLink('order', true, (int)$this->context->language->id, $params); + + $params = array('back' => $back_url, 'id_address' => ($bad_delivery ? (int)$this->context->cart->id_address_delivery : (int)$this->context->cart->id_address_invoice)); + if ($multi) + $params['multi-shipping'] = $multi; + Tools::redirect($this->context->link->getPageLink('address', true, (int)$this->context->language->id, $params)); } } diff --git a/themes/default-bootstrap/order-address-multishipping.tpl b/themes/default-bootstrap/order-address-multishipping.tpl index 0fcbdb7853c31..bbbf2886c17d5 100644 --- a/themes/default-bootstrap/order-address-multishipping.tpl +++ b/themes/default-bootstrap/order-address-multishipping.tpl @@ -76,9 +76,9 @@ {if $back} - {l s='Continue Shopping'} + {l s='Continue Shopping'} {else} - {l s='Continue Shopping'} + {l s='Continue Shopping'} {/if}

diff --git a/themes/default-bootstrap/order-address.tpl b/themes/default-bootstrap/order-address.tpl index 711b1a285e521..136d27517e7aa 100644 --- a/themes/default-bootstrap/order-address.tpl +++ b/themes/default-bootstrap/order-address.tpl @@ -102,7 +102,7 @@

- + {l s='Continue Shopping'} diff --git a/themes/default-bootstrap/order-carrier.tpl b/themes/default-bootstrap/order-carrier.tpl index 9305383ceba4a..1a164f9c00155 100644 --- a/themes/default-bootstrap/order-carrier.tpl +++ b/themes/default-bootstrap/order-carrier.tpl @@ -29,7 +29,7 @@

{l s='Shipping:'}

{include file="$tpl_dir./order-steps.tpl"} {include file="$tpl_dir./errors.tpl"} -
+ {else}

2 {l s='Delivery methods'}

@@ -342,18 +342,18 @@ {if !$is_guest} {if $back} - + {l s='Continue shopping'} {else} - + {l s='Continue shopping'} {/if} {else} - + {l s='Continue shopping'} diff --git a/themes/default-bootstrap/order-steps.tpl b/themes/default-bootstrap/order-steps.tpl index 9b7a08dab31f3..2c2ad2ba64579 100644 --- a/themes/default-bootstrap/order-steps.tpl +++ b/themes/default-bootstrap/order-steps.tpl @@ -46,7 +46,7 @@
  • {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address'} - + 02. {l s='Sign in'} {else} @@ -55,7 +55,7 @@
  • {if $current_step=='payment' || $current_step=='shipping'} - + 03. {l s='Address'} {else} @@ -64,7 +64,7 @@
  • {if $current_step=='payment'} - + 04. {l s='Shipping'} {else}