// 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:
rGaillard
2012-10-01 14:35:34 +00:00
parent 1096d7dc44
commit 28d9b3cb2b
+10 -5
View File
@@ -76,16 +76,21 @@ class AddressControllerCore extends FrontController
{
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->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');
}
$this->errors[] = Tools::displayError('This address cannot be deleted.');
}
}
else if ($this->ajax)
elseif ($this->ajax)
exit;
else
Tools::redirect('index.php?controller=addresses');