Fixed: Order related address process issues

This commit is contained in:
vishalsingh.qlo325
2025-05-10 15:25:20 +05:30
parent 90974014ba
commit 854903e2ad
2 changed files with 22 additions and 3 deletions

View File

@@ -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';