Hi sorry ! i'm using the last version of prestashop 1.7.6.5
So i registered the hook, but i don't understand the "ps native module for exemple" ?
<?php if (!defined('_PS_VERSION_')) { exit; } class iModelAttachToClientGroup extends Module { public function __construct() { $this->name = 'imodelattachtoclientgroup'; $this->tab = 'others'; $this->version = '1.0.1'; $this->author = 'Quentin'; $this->need_instance = 0; $this->ps_versions_compliancy = [ 'min' => '1.6', 'max' => _PS_VERSION_ ]; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('iModel Attach user To Client Group'); $this->description = $this->l('When a customer subscribe to our website, hes attached to the customer group Particuliers TTC, This module add him also into Client group.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('MYMODULE_NAME')) { $this->warning = $this->l('No name provided'); } } public function install() { return parent::install() and $this->registerHook('hookactionCustomerAccountAdd'); } public function uninstall() { return parent::uninstall(); } /*public function hookcreateAccount($params) { $this->context->customer->addGroups(array(3)); //$this->context->customer->addGroups(3); $this->context->customer->update(); print_r("print_r TEST"); ppp("test ppp"); }*/ public function hookactionCustomerAccountAdd(){ $this->context->customer->addGroups(array(3)); //$this->context->customer->addGroups(3); $this->context->customer->update(); print_r("print_r TEST"); ppp("test ppp"); } }