Skip to content

Commit

Permalink
nenes25#7 Nouveau hook permettant la mise à jour du groupe suite à la…
Browse files Browse the repository at this point in the history
… mise à jour d'une adresse
  • Loading branch information
bastienuh committed Jun 7, 2021
1 parent 63e70e4 commit 2929898
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion customerautogroups/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#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
15 changes: 13 additions & 2 deletions customerautogroups/customerautogroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2929898

Please sign in to comment.