diff --git a/customerautogroups/changelog.txt b/customerautogroups/changelog.txt index 7221473..7f01856 100644 --- a/customerautogroups/changelog.txt +++ b/customerautogroups/changelog.txt @@ -11,4 +11,5 @@ V 0.3.4 - 2016-12-07 : PS norms V 0.4.0 - 2017-04-06 : Compatibilité Prestashop 1.7 // Prestashop 1.7 compatibility V 0.5.0 - 2017-06-15 : Nouvelles conditions de filtres NOT LIKE, IN, NOT IN // New filters conditions NOT LIKE, IN, NOT IN V 0.5.1 - 2021-06-02 : #4 Backend error - #5 Fix Column 'name' in where clause is ambiguous \ No newline at end of file + #5 Fix Column 'name' in where clause is ambiguous +V 0.5.2 - 2021-06-07 : #7 Nouveau hook permettant la mise à jour du groupe suite à la mise à jour d'une adresse \ No newline at end of file diff --git a/customerautogroups/customerautogroups.php b/customerautogroups/customerautogroups.php index 1dc6ad5..c24a1d7 100644 --- a/customerautogroups/customerautogroups.php +++ b/customerautogroups/customerautogroups.php @@ -25,7 +25,7 @@ public function __construct() $this->author = 'hhennes'; $this->name = 'customerautogroups'; $this->tab = 'others'; - $this->version = '0.5.1'; + $this->version = '0.5.2'; $this->bootstrap = true; $this->need_instance = 0; @@ -40,7 +40,7 @@ public function __construct() */ public function install() { - if (!parent::install() || !$this->registerHook('actionCustomerAccountAdd')) { + if (!parent::install() || !$this->registerHook('actionCustomerAccountAdd') || !$this->registerHook('actionObjectAddressUpdateAfter')) { return false; } @@ -132,6 +132,17 @@ public function hookActionCustomerAccountAdd($params) $this->_processGroupRules($params['newCustomer']); } + /** + * Hook Exécuté après la mise à jour d'une adresse + * @param array $params : informations du compte client créé + */ + public function hookActionObjectAddressUpdateAfter($params) + { + $customer = new Customer($params['object']->id_customer); + + $this->_processGroupRules($customer); + } + /** * Traitement des règles * @param Customer $customer