// Fix #PSCFV-4562
This commit is contained in:
1 parent
a1a625570a
commit
ec734e323a
1 file changed
+10
-5
@@ -76,16 +76,21 @@ class AddressControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
if (Tools::isSubmit('delete'))
|
if (Tools::isSubmit('delete'))
|
||||||
{
|
{
|
||||||
if ($this->context->cart->id_address_invoice == $this->_address->id)
|
|
||||||
unset($this->context->cart->id_address_invoice);
|
|
||||||
if ($this->context->cart->id_address_delivery == $this->_address->id)
|
|
||||||
unset($this->context->cart->id_address_delivery);
|
|
||||||
if ($this->_address->delete())
|
if ($this->_address->delete())
|
||||||
|
{
|
||||||
|
if ($this->context->cart->id_address_invoice == $this->_address->id)
|
||||||
|
unset($this->context->cart->id_address_invoice);
|
||||||
|
if ($this->context->cart->id_address_delivery == $this->_address->id)
|
||||||
|
{
|
||||||
|
unset($this->context->cart->id_address_delivery);
|
||||||
|
$this->context->cart->updateAddressId($this->_address->id, (int)Address::getFirstCustomerAddressId(Context::getContext()->customer->id));
|
||||||
|
}
|
||||||
Tools::redirect('index.php?controller=addresses');
|
Tools::redirect('index.php?controller=addresses');
|
||||||
|
}
|
||||||
$this->errors[] = Tools::displayError('This address cannot be deleted.');
|
$this->errors[] = Tools::displayError('This address cannot be deleted.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($this->ajax)
|
elseif ($this->ajax)
|
||||||
exit;
|
exit;
|
||||||
else
|
else
|
||||||
Tools::redirect('index.php?controller=addresses');
|
Tools::redirect('index.php?controller=addresses');
|
||||||
|
|||||||
Reference in new issue
Block a user