Adding a callback to options

One last method I want to introduce you to is onClickOption. This method will permit you to set the JavaScript OnClick trigger on the module's action buttons.

Here are the different action buttons that are compliant with the onClickOption method:

Adding a callback to options

You are probably wondering when we should use the onClickOption method.

This method allows many possibilities. For example, in the case of our module, when the merchant uninstalls the module, it automatically drops the table of comments. When the merchant decides to reinstall the module, he won't retrieve the old comments.

Clicking the uninstall button by mistake is possible. With ...

Get PrestaShop Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.