name = 'ant_infocustomer'; $this->tab = 'administration'; $this->author = 'Antadis'; $this->version = '1.0'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Information about customer'); $this->description = $this->l('Block of information about customer in BO'); } private $hooks = array( 'rightColumnSav' => array('BO SAV right column', 'Allow to add information in right column of SAV message thread'), ); public function install() { foreach($this->hooks as $k => $v) { if(count(Db::getInstance()->ExecuteS(' SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = "'.$k.'" LIMIT 1 ')) == 0) { Db::getInstance()->ExecuteS(' INSERT INTO `'._DB_PREFIX_.'hook` VALUES (DEFAULT, "'.$k.'", "'.$v[0].'", "'.$v[1].'", 0, 0) '); } } $install_success = parent::install(); if ($install_success) { foreach($this->hooks as $k => $v) { $install_success = $this->registerHook($k); if (!$install_success) { break; } } } return $install_success; } public function hookRightColumnSav($params) { if(isset($params['customer'])) { global $cookie; echo ""; $customersToken = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee)); echo '

'.$this->l('Customer Information' ).'

'.ucfirst($params['customer']->firstname).' '.ucfirst($params['customer']->lastname).' ('.$params['customer']->id.')

'.$params['customer']->email.'

'.$params['customer_info']['nb_orders'].' '.$this->l('valid orders').'

'; } } }