// Fix #PSCFV-4562
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17650 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -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