Contributing a new hook to PrestaShop is a geat way to extend the software’s capabilities, but it requires a few steps to be done properly that we called the “definition of ready”.
So, before you start submitting a pull request, make sure you have completed the following steps.
hook.xml
fileMake sure the hook have a clear description in the hook.xml
file located in the install-dev/data/xml/
folder.
This description must be clear and concise, and should help developers understand where this hook is dispatched or what the hook aims to do.
<hook id="actionMaintenancePageFormSave">
<name>actionMaintenancePageFormSave</name>
<title>Processing Maintenance page form</title>
<description>This hook is called when the Maintenance Page form is processed</description>
</hook>
Don’t forget to describe how to test the hook in your pull request. This is important for the reviewer to understand how the new hook works and how to test it.
Providing a small test module in your pull request to validate the use case is a good practice, and helps reviewers to validate your new hook faster.
When your pull request is ready and submitted, don’t forget to trigger the UI auto tests to make sure your new hook doesn’t break anything else in PrestaShop.
You can follow the readme file in the ga.tests.ui.pr
repository to know how to trigger the UI tests directly on github.
Then, add the url of the UI tests previously launched directly in your pull request description!
Hook Contribution
labelWe have a specific label for hook contributions, and this label must be added automatically by our bots.
If for some reason the label is not added, please ping the @PrestaShop/committers
team in the pull request comments!