-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# How To add a new Hook | ||
Adding a new hook is quite a simple process. It can be done in only tree steps. | ||
|
||
## 1) Add a call to Hook::exec() | ||
|
||
As you can see on this [PR](https://github.com/PrestaShop/PrestaShop/pull/34431/files) Adding a simple Hook::exex() statement is enought to add a new hook. In order for it to be complete, there is a couple more steps to do. | ||
|
||
## 2) Modify the hook.xlm file | ||
|
||
In order to properly register the hook you need to add it to the hook.xml file as seen in this [PR](https://github.com/PrestaShop/PrestaShop/pull/34431/files) | ||
|
||
## 3) Add the new hook in the Autoupgrade fixture | ||
|
||
Finally, to allow your new hook to be available during an update, you need to add it to the current version SQL script of the Autoupgrade module. As it can be seen in this [PR](https://github.com/PrestaShop/autoupgrade/pull/672/files) |