From 84b6222de163d6c4f27f4a5683bff4184dd42a5b Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 9 Jan 2013 18:20:25 +0100 Subject: [PATCH 1/2] [-] FO : Fix backslashes for smartyTranslate and js=1 --- config/smartyfront.config.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/smartyfront.config.inc.php b/config/smartyfront.config.inc.php index 828efd3c9..70de9a1bb 100644 --- a/config/smartyfront.config.inc.php +++ b/config/smartyfront.config.inc.php @@ -63,6 +63,6 @@ function smartyTranslate($params, &$smarty) if ($params['sprintf'] !== null) $msg = Translate::checkAndReplaceArgs($msg, $params['sprintf']); - return $params['js'] ? addslashes($msg) : $msg; + return $params['js'] ? $msg : Tools::safeOutput($msg); } From ffa3be6e896a72e8600bb256551f098600176ce4 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 9 Jan 2013 18:23:40 +0100 Subject: [PATCH 2/2] [-] FO : fix #PSCFV-6165 cart update when inactive country in old address --- controllers/front/OrderController.php | 32 +++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php index 60757bb7b..039688d14 100644 --- a/controllers/front/OrderController.php +++ b/controllers/front/OrderController.php @@ -255,6 +255,21 @@ class OrderControllerCore extends ParentOrderController $this->errors[] = Tools::displayError('Invalid address', !Tools::getValue('ajax')); else { + $this->context->cart->id_address_delivery = (int)Tools::getValue('id_address_delivery'); + $this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)Tools::getValue('id_address_invoice'); + + CartRule::autoRemoveFromCart($this->context); + CartRule::autoAddToCart($this->context); + + if (!$this->context->cart->update()) + $this->errors[] = Tools::displayError('An error occurred while updating your cart.', !Tools::getValue('ajax')); + + if (!$this->context->cart->isMultiAddressDelivery()) + $this->context->cart->setNoMultishipping(); // If there is only one delivery address, set each delivery address lines with the main delivery address + + if (Tools::isSubmit('message')) + $this->_updateMessage(Tools::getValue('message')); + // Add checking for all addresses $address_without_carriers = $this->context->cart->getDeliveryAddressesWithoutCarriers(); if (count($address_without_carriers)) @@ -266,23 +281,6 @@ class OrderControllerCore extends ParentOrderController else $this->errors[] = sprintf(Tools::displayError('There are no carriers that deliver to the address you selected.', !Tools::getValue('ajax'))); } - else - { - $this->context->cart->id_address_delivery = (int)Tools::getValue('id_address_delivery'); - $this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)Tools::getValue('id_address_invoice'); - - CartRule::autoRemoveFromCart($this->context); - CartRule::autoAddToCart($this->context); - - if (!$this->context->cart->update()) - $this->errors[] = Tools::displayError('An error occurred while updating your cart.', !Tools::getValue('ajax')); - - if (!$this->context->cart->isMultiAddressDelivery()) - $this->context->cart->setNoMultishipping(); // If there is only one delivery address, set each delivery address lines with the main delivery address - - if (Tools::isSubmit('message')) - $this->_updateMessage(Tools::getValue('message')); - } } if ($this->errors)