[-] 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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11791 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mBertholino
2011-12-27 13:46:52 +00:00
parent 79d4bd7c1d
commit 241afd9767
@@ -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
*