From 5a815e7b1927b8bc75cd96bf9df219044b3bc1df Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 18 Apr 2013 11:26:50 +0200 Subject: [PATCH] [-] FO : Fix bug #PSCFV-8728 context country not updated after changing delivery address in OPC --- controllers/front/OrderOpcController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 225f0e30a..166afebeb 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -190,6 +190,13 @@ class OrderOpcControllerCore extends ParentOrderController $this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice')); if (!$this->context->cart->update()) $this->errors[] = Tools::displayError('An error occurred while updating your cart.'); + + $infos = Address::getCountryAndState((int)($this->context->cart->id_address_delivery)); + if (isset($infos['id_country']) && $infos['id_country']) + { + $country = new Country((int)$infos['id_country']); + $this->context->country = $country; + } // Address has changed, so we check if the cart rules still apply CartRule::autoRemoveFromCart($this->context);