Book Image

PrestaShop Module Development

By : Fabien Serny
Book Image

PrestaShop Module Development

By: Fabien Serny

Overview of this book

Table of Contents (19 chapters)
PrestaShop Module Development
About the Author
About the Reviewers

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') ||
  !$this->registerHook('displayAdminProductsExtra') ||
    return false;

You will then create the corresponding method using the same controller system as other hooks:

public function...