Adding support of custom hooks to PrestaShop modules


Adding new custom hooks to the shop is not enough to assign the modules there. Your modules must have function to support new position like it has for other functions. Whole process depends on the module you use, the easiest way is to copy-paste other function and change its name.

lets say we added hook named "displayMyHook"
your module has support of "displayLeftColumn" hook by default.

open module file,
duplicate function with name:
public function hookdisplayLeftColumn($params) {
//...
//here original contents of function
//...
}
and change its name to hookdisplayMyHook($params)
public function hookdisplayMyHook($params) {
//...
//here original contents of function
//...
}
Share on Google Plus

About VEKIA

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a comment