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
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The list of all the dynamic hooks


The following table will teach you about the 15 different dynamic hooks that PrestaShop offers:

Hook name

Description

Parameters

Files

actionAdmin{Action}After

This hook is used to trigger actions after the {Action} of any controller is made.

controller: This contains the Controller object.

/classes/controller/AdminController.php

actionAdmin{Action}Before

This hook is used to trigger actions before the {Action} of any controller is made.

controller: This contains the Controller object.

/classes/controller/AdminController.php

actionObject{ObjectModel}AddAfter

This hook is used to trigger actions at the end of the parent add method of the {ObjectModel} variable.

object: This contains the concerned object.

/classes/ObjectModel.php

actionObject{ObjectModel}AddBefore

This hook is used to trigger actions at the beginning of the parent add method of the {ObjectModel} variable.

object: This contains the concerned object.

/classes/ObjectModel.php

actionObject{ObjectModel}DeleteAfter

This hook is used to trigger actions at the end of the parent delete method of the {ObjectModel} variable.

object: This contains the concerned object.

/classes/ObjectModel.php

actionObject{ObjectModel}DeleteBefore

This hook is used to trigger actions at the beginning of the parent delete method of the {ObjectModel} variable.

object: This contains the concerned object.

/classes/ObjectModel.php

actionObject{ObjectModel}UpdateAfter

This hook is used to trigger actions at the end of the parent update method of the {ObjectModel} variable.

object: This contains the concerned object.

/classes/ObjectModel.php

actionObject{ObjectModel}UpdateBefore

This hook is used to trigger actions at the beginning of the parent update method of the {ObjectModel} variable.

object: This contains the concerned object.

/classes/ObjectModel.php

action{AdminController}{Action}After

This hook is used to trigger actions after the {Action} of the {AdminController} controller is made.

controller: This contains the Controller object.

/classes/controller/AdminController.php

/controllers/admin/AdminPerformanceController.php

action{AdminController}{Action}Before

This hook is used to trigger actions before the {Action} of the {AdminController} controller is made.

controller: This contains the Controller object.

/classes/controller/AdminController.php

/controllers/admin/AdminPerformanceController.php

display{AdminController}Form

This hook is used to display elements in the add/edit form of {AdminController}.

None

/admin/themes/default/template/helpers/form/form.tpl

display{AdminController}ListAfter

This hook is used to display elements on the bottom of the {AdminController} list.

None

/admin/themes/default/template/helpers/list/list_footer.tpl

display{AdminController}ListBefore

This hook is used to display elements on top of the {AdminController} list.

None

/admin/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl

/admin/themes/default/template/helpers/list/list_header.tpl

display{AdminController}Options

This hook is used to display elements at the bottom of the {AdminController} configuration form.

None

/admin/themes/default/template/helpers/options/options.tpl

display{AdminController}View

This hook is used to display elements at the bottom of the {AdminController} view page.

None

/admin/themes/default/template/helpers/view/view.tpl

Definitions of the variables

The following are the definitions of the variables that are used in the dynamic hooks of PrestaShop (displayed in the preceding table):

  • The value of {Action} can be one of the following: delete_image, delete, status, position, save, new, view, export, reset_filters, update_options, and update_fields

  • The value of {AdminController} can be the name of any admin controller, either natively available or installed

  • The value of {ObjectModel} can be the name of any ObjectModel class, either natively available or installed