Merge pull request #701 from shreesh-webkul/gli-1145
Resolve: Address not updating on admin address and order page.
This commit is contained in:
@@ -251,10 +251,13 @@ class AddressCore extends ObjectModel
|
||||
$errors = parent::validateController($htmlentities);
|
||||
|
||||
// for customer address we need to check of customer address already exists.
|
||||
if ($idCustomer = Tools::getValue('id_customer')) {
|
||||
if ($id_address = Customer::getCustomerIdAddress($idCustomer)) {
|
||||
// if we are editing an address we do not need to validate already created address.
|
||||
if (!Validate::isLoadedObject($this)) {
|
||||
if ($idCustomer = Tools::getValue('id_customer')) {
|
||||
if ($id_address = Customer::getCustomerIdAddress($idCustomer)) {
|
||||
|
||||
$errors[] = sprintf(Tools::displayError('Customer address already exists. Id address: #%d'), $id_address);
|
||||
$errors[] = sprintf(Tools::displayError('Customer address already exists. Id address: #%d'), $id_address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -366,7 +366,12 @@ class AdminAddressesControllerCore extends AdminController
|
||||
$this->redirect_after = false;
|
||||
}
|
||||
|
||||
$address = new Address();
|
||||
if ($idAddress = Tools::getValue('id_address')) {
|
||||
$address = new Address($idAddress);
|
||||
} else {
|
||||
$address = new Address();
|
||||
}
|
||||
|
||||
$this->errors = $address->validateController();
|
||||
|
||||
// Transform e-mail in id_customer for parent processing
|
||||
|
||||
Reference in New Issue
Block a user