Merge branch 'fix-OnCustomerRemoving'
This commit is contained in:
commit
1364d1214a
@ -11,4 +11,18 @@ class Customer extends CustomerCore
|
||||
);
|
||||
return '<img src="/img/l/'.(int) $versions[$value].'.jpg" alt="" />';
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$addresses = $this->getAddresses((int)(Configuration::get('PS_LANG_DEFAULT')));
|
||||
foreach ($addresses AS $address)
|
||||
{
|
||||
$obj = new Address((int)($address['id_address']));
|
||||
$obj->delete();
|
||||
}
|
||||
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_group` WHERE `id_customer` = '.(int)($this->id));
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customer_thread` SET `id_customer` = 0 WHERE `id_customer` = '.(int)($this->id));
|
||||
Discount::deleteByIdCustomer((int)($this->id));
|
||||
return parent::delete();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user