mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-21 12:46:06 +03:00
Closes #200 - Address fix
This commit is contained in:
parent
fb7290f865
commit
75fc11c6f9
@ -315,10 +315,17 @@ class ModelExtensionRetailcrmHistory extends Model {
|
||||
$this->customers_history->handleCustomer($customer_data, $customer);
|
||||
$this->customers_history->handleCustomFields($customer_data, $customer);
|
||||
|
||||
$updateAddress = $this->customers_history->handleAddress($customer, array(), $customer_data['address_id']);
|
||||
$addresses = $this->model_customer_customer->getAddresses($customer_id);
|
||||
$addresses[$customer_data['address_id']] = $updateAddress;
|
||||
$customer_data['address'] = $addresses;
|
||||
if (empty($customer_data['address_id'])) {
|
||||
$address = $this->customers_history->handleAddress($customer, array());
|
||||
$addresses = $this->model_customer_customer->getAddresses($customer_id);
|
||||
$addresses[] = $address;
|
||||
$customer_data['address'] = $addresses;
|
||||
} else {
|
||||
$updateAddress = $this->customers_history->handleAddress($customer, array(), $customer_data['address_id']);
|
||||
$addresses = $this->model_customer_customer->getAddresses($customer_id);
|
||||
$addresses[$customer_data['address_id']] = $updateAddress;
|
||||
$customer_data['address'] = $addresses;
|
||||
}
|
||||
|
||||
$this->model_customer_customer->editCustomer($customer_id, $customer_data);
|
||||
}
|
||||
|
@ -53,7 +53,9 @@ class Customer {
|
||||
if ($address_id) {
|
||||
$customer_address = $this->customer_repository->getAddress($address_id);
|
||||
} else {
|
||||
$customer_address = array();
|
||||
$customer_address = array(
|
||||
'address_id' => ''
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($customer['address']['countryIso'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user