Line 76:
Line 76:
Note: you can find the current module's context with print('Module context: '.$object->context); (put this inside the module's php file where the hook resides and that you want to hook).
Note: you can find the current module's context with print('Module context: '.$object->context); (put this inside the module's php file where the hook resides and that you want to hook).
−
'''IMPORTANT''': Be careful: do not forget to DISABLE then RENABLE the module in the admin panel to accept the new context, because these constants are only added to the database when enabling the module.
+
[[File:warning.png]]: Be careful: do not forget to DISABLE then ENABLE the module in the admin panel to accept the new context, because these constants are only added to the database when enabling the module.
Line 93:
Line 93:
* @return void
* @return void
*/
*/
−
function doActions($parameters, $object, $action)
+
function doActions($parameters, &$object, &$action, $hookmanager)
{
{
print_r($parameters);
print_r($parameters);
Line 118:
Line 118:
* '''$object''' is the object that you may work on. Eg: the product if you are in the productcard context.
* '''$object''' is the object that you may work on. Eg: the product if you are in the productcard context.
* '''$action''' is the action if one is conveyed (generally "create", "edit" or "view").
* '''$action''' is the action if one is conveyed (generally "create", "edit" or "view").
+
* '''$hookmanager''' is propagated only to allow your hook to call another hook.
'''Returns''':
'''Returns''':