bebeboutik/override/classes/Customer.php
2017-09-01 11:22:11 +02:00

29 lines
846 B
PHP

<?php
class Customer extends CustomerCore
{
public function printVersion($value, $params)
{
$versions = array(
'en' => 1,
'fr' => 2,
'es' => 3,
'it' => 5,
);
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 ObjectModel::delete();
}
}