[-] BO : PSTEST-200 : bug fixed : When an administrator made modifications on a customer about the newsletter option or the Opt-in option, customer's addresses were deleted
This commit is contained in:
@@ -765,6 +765,18 @@ class AdminCustomersControllerCore extends AdminController
|
||||
parent::processSave($token);
|
||||
}
|
||||
|
||||
public function afterDelete($object, $oldId)
|
||||
{
|
||||
$customer = new Customer($oldId);
|
||||
$addresses = $customer->getAddresses($this->default_form_language);
|
||||
foreach ($addresses as $k => $v)
|
||||
{
|
||||
$address = new Address($v['id_address']);
|
||||
$address->id_customer = $object->id;
|
||||
$address->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Transform a guest account into a registered customer account
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user