Reader small image

You're reading from  PrestaShop Module Development

Product typeBook
Published inNov 2014
Reading LevelBeginner
Publisher
ISBN-139781783280254
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Fabien Serny
Fabien Serny
author image
Fabien Serny

Fabien Serny is a former core developer at PrestaShop. He has 10 years of experience in web development and e-commerce. He has worked for several big e-commerce companies in France, and then created his own company named 23Prod in late 2010. In 2014, along with two other former core developers from PrestaShop, he launched Froggy Commerce, a platform that sells simple and powerful modules for PrestaShop based on the needs of e-tailers. You can visit his websites http://www.23prod.com and http://www.froggy-commerce.com.
Read more about Fabien Serny

Right arrow

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

lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
PrestaShop Module Development
Published in: Nov 2014Publisher: ISBN-13: 9781783280254

Author (1)

author image
Fabien Serny

Fabien Serny is a former core developer at PrestaShop. He has 10 years of experience in web development and e-commerce. He has worked for several big e-commerce companies in France, and then created his own company named 23Prod in late 2010. In 2014, along with two other former core developers from PrestaShop, he launched Froggy Commerce, a platform that sells simple and powerful modules for PrestaShop based on the needs of e-tailers. You can visit his websites http://www.23prod.com and http://www.froggy-commerce.com.
Read more about Fabien Serny