mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-21 20:56:07 +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->handleCustomer($customer_data, $customer);
|
||||||
$this->customers_history->handleCustomFields($customer_data, $customer);
|
$this->customers_history->handleCustomFields($customer_data, $customer);
|
||||||
|
|
||||||
$updateAddress = $this->customers_history->handleAddress($customer, array(), $customer_data['address_id']);
|
if (empty($customer_data['address_id'])) {
|
||||||
$addresses = $this->model_customer_customer->getAddresses($customer_id);
|
$address = $this->customers_history->handleAddress($customer, array());
|
||||||
$addresses[$customer_data['address_id']] = $updateAddress;
|
$addresses = $this->model_customer_customer->getAddresses($customer_id);
|
||||||
$customer_data['address'] = $addresses;
|
$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);
|
$this->model_customer_customer->editCustomer($customer_id, $customer_data);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,9 @@ class Customer {
|
|||||||
if ($address_id) {
|
if ($address_id) {
|
||||||
$customer_address = $this->customer_repository->getAddress($address_id);
|
$customer_address = $this->customer_repository->getAddress($address_id);
|
||||||
} else {
|
} else {
|
||||||
$customer_address = array();
|
$customer_address = array(
|
||||||
|
'address_id' => ''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($customer['address']['countryIso'])) {
|
if (isset($customer['address']['countryIso'])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user