Reputation: 3
I am currently new to prestashop.
I managed to build a simple module (in prestashop 1.7), but I also want my module to trigger some code when a product or category is changed/added/deleted.
How can I do that?
Upvotes: 0
Views: 337
Reputation: 2987
ObjectModel calls this after every add:
Hook::exec('actionObject'.$this->getFullyQualifiedName().'AddAfter', array('object' => $this));
and every update:
Hook::exec('actionObject'.$this->getFullyQualifiedName().'UpdateAfter', array('object' => $this));
and every deletion:
Hook::exec('actionObject'.$this->getFullyQualifiedName().'DeleteAfter', array('object' => $this));
So hook to actionObjectProductAddAfter
, actionObjectProductUpdateAfter
and actionObjectProductDeleteAfter
for products, and the same for categories.
Upvotes: 1