PrestashopUser03 Posted January 14, 2021 Share Posted January 14, 2021 (edited) Bonjour à tous, Je souhaiterais déclencher une série d'action immédiatement après les commandes du client, est-ce possible, existe-t-il un hook permettant de faire ça ? J'ai consulté la liste complète et je n'ai pas trouvé. Merci d'avance Edited January 20, 2021 by PrestashopUser03 (see edit history) Link to comment Share on other sites More sharing options...
idnovate.com Posted January 14, 2021 Share Posted January 14, 2021 hookActionValidateOrder Link to comment Share on other sites More sharing options...
PrestashopUser03 Posted January 14, 2021 Author Share Posted January 14, 2021 Super, je vais tester ça, merci beaucoup ! Link to comment Share on other sites More sharing options...
PrestashopUser03 Posted January 15, 2021 Author Share Posted January 15, 2021 J'ai utilisé ce hook pour ajouter des infos en bdd mais ça ne fonctionne pas, il y a quelque chose que je ne saisis pas ? (le hook est bien register) public function hookActionValidateOrder($params){ $order = $params['order']; if (!Validate::isLoadedObject($order)) { $sql="INSERT INTO "._DB_PREFIX_."hb_atelier_materiel(hb_atelier_materiel_id,hb_atelier_materiel_marque) VALUES(150, 'test')"; $result=\Db::getInstance()->execute($sql); } } Link to comment Share on other sites More sharing options...
Mediacom87 Posted January 15, 2021 Share Posted January 15, 2021 il y a 37 minutes, PrestashopUser03 a dit : $result=\Db::getInstance()->execute($sql); c'est quoi le \ devant le Db:: ? Link to comment Share on other sites More sharing options...
PrestashopUser03 Posted January 20, 2021 Author Share Posted January 20, 2021 Ok, j'ai compris d'où vient le problème. Au moment de greffer le hook sur le module, j'ai mit : return parent::install() && $this->registerHook('hookActionValidateOrder') au lieu de return parent::install() && $this->registerHook('actionValidateOrder') tout fonctionne correctement maintenant. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now