From 60cbdb8f4f11884cde41d3696b18a34aff64eac7 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Mon, 10 Sep 2012 10:01:01 +0000 Subject: [PATCH] [-] BO : set addresses to deleted when customer set to deleted #PSCFV-3975 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17266 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Customer.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/Customer.php b/classes/Customer.php index a5c4e3930..9455a3959 100644 --- a/classes/Customer.php +++ b/classes/Customer.php @@ -224,6 +224,17 @@ class CustomerCore extends ObjectModel $this->newsletter_date_add = date('Y-m-d H:i:s'); if (Context::getContext()->controller->controller_type == 'admin') $this->updateGroup($this->groupBox); + + if ($this->deleted) + { + $addresses = $this->getAddresses((int)Configuration::get('PS_LANG_DEFAULT')); + foreach ($addresses as $address) + { + $obj = new Address((int)$address['id_address']); + $obj->delete(); + } + } + return parent::update(true); }