[-] FO : Fix bug #PSCFV-8728 context country not updated after changing delivery address in OPC
This commit is contained in:
@@ -191,6 +191,13 @@ class OrderOpcControllerCore extends ParentOrderController
|
|||||||
if (!$this->context->cart->update())
|
if (!$this->context->cart->update())
|
||||||
$this->errors[] = Tools::displayError('An error occurred while updating your cart.');
|
$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
|
// Address has changed, so we check if the cart rules still apply
|
||||||
CartRule::autoRemoveFromCart($this->context);
|
CartRule::autoRemoveFromCart($this->context);
|
||||||
CartRule::autoAddToCart($this->context);
|
CartRule::autoAddToCart($this->context);
|
||||||
|
|||||||
Reference in New Issue
Block a user