Fixed: Order related address process issues
This commit is contained in:
@@ -457,6 +457,10 @@ class AdminAddressesControllerCore extends AdminController
|
||||
** we delete its id_address to force the creation of a new one */
|
||||
if ((int)Tools::getValue('id_order')) {
|
||||
$this->_redirect = false;
|
||||
// set deleted=1 as customer can have only one address and this address is for an order only
|
||||
if (!$address->isUsed() || !$idAddress) {
|
||||
$_POST['deleted'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the requires fields which are settings in the BO
|
||||
@@ -465,7 +469,11 @@ class AdminAddressesControllerCore extends AdminController
|
||||
|
||||
$return = false;
|
||||
if (empty($this->errors)) {
|
||||
$return = parent::processSave();
|
||||
if (($return = parent::processSave())
|
||||
&& $return->id != $this->object->id
|
||||
) {
|
||||
$this->object = new Address($return->id);
|
||||
}
|
||||
} else {
|
||||
// if we have errors, we stay on the form instead of going back to the list
|
||||
$this->display = 'edit';
|
||||
|
||||
Reference in New Issue
Block a user