[-] 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:
mBertholino
2011-12-27 13:46:52 +00:00
parent 868bc4adb6
commit fbc6ee252c

View File

@@ -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
*