Using back office hooks

Admin controllers are useful to create a new tab. However, if you need to alter existing tabs, you will need to use hooks in the back office. In this section, we will use only some of the hooks available. It is recommended that you read the exhaustive list of hooks at the end of the book to see all the various possibilities.

Attaching your module to a product hook

The product administration tool is composed of several sub tabs. There is a hook that permits you to add subtabs on this section: displayAdminProductsExtra.

To do so, you just have to register the hook in the constructor of your main class, (mymodcomments.php):

// Register hooks if (!$this->registerHook('displayProductTabContent') || !$this->registerHook('displayBackOfficeHeader') ...

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.