Child pages
  • Hooks in PrestaShop 1.5
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Table of content

Hooks in PrestaShop 1.5

Hooks in PrestaShop 1.5 have a new naming scheme, with a situation specific prefix:

  • action. These hooks are triggered by specific events that take place in PrestaShop.
  • display. These hooks result in something being displayed, either in the front-end or the back-end.

This way, you will know right away what type of hook you are dealing with. Older hooks have been renamed to match this scheme.

New & updated hooks

All hooks in PrestaShop have been updated for version 1.5, and several new ones were added.

The following "new hooks" and "updated hooks" lists were automatically generated by a script. Hook descriptions appear as they are in the PrestaShop database, and can sometimes be missing.

New hooks

Hook name

Hook description

actionAdminMetaControllerUpdate_optionsBefore

 

actionAdminMetaSave

After saving configuration in AdminMeta

actionAttributeDelete

On deleting attribute feature value

actionAttributeGroupDelete

On deleting attribute group

actionAttributeGroupSave

On saving attribute group

actionAttributePostProcess

On post-process in admin feature value

actionAttributeSave

On saving attribute feature value

actionAuthentication

 

actionBeforeAuthentication

Before authentication

actionCarrierProcess

 

actionCarrierUpdate

This hook is called when a carrier is updated

actionCartSave

 

actionCategoryAdd

 

actionCategoryDelete

 

actionCategoryUpdate

 

actionCustomerAccountAdd

Called when a new customer successfully creates account

actionFeatureDelete

On deleting attribute feature

actionFeatureSave

On saving attribute feature

actionFeatureValueDelete

On deleting attribute feature value

actionFeatureValueSave

On saving attribute feature value

actionHtaccessCreate

After .htaccess creation

actionObjectCategoryDeleteAfter

 

actionObjectCategoryUpdateAfter

 

actionObjectCmsDeleteAfter

 

actionObjectCmsUpdateAfter

 

actionObjectManufacturerDeleteAfter

 

actionObjectManufacturerUpdateAfter

 

actionObjectProductDeleteAfter

 

actionObjectProductUpdateAfter

 

actionObjectSupplierDeleteAfter

 

actionObjectSupplierUpdateAfter

 

actionOrderDetail

To set the follow-up in Smarty when order detail is called.

actionOrderReturn

 

actionOrderSlipAdd

Called when a quantity of one product change in an order.

actionOrderStatusPostUpdate

 

actionOrderStatusUpdate

Launch modules when the order's status changes.

actionPaymentCCAdd

Payment CC added

actionPaymentConfirmation

 

actionProductAdd

 

actionProductAttributeDelete

 

actionProductAttributeUpdate

 

actionProductCancel

This hook is called when you cancel a product in an order

actionProductDelete

This hook is called when a product is deleted

actionProductListOverride

Assign product list to a category

actionProductOutOfStock

Make action while product is out of stock

actionProductSave

On saving products

actionProductUpdate

 

actionSearch

 

actionShopDataDuplication

 

actionTaxManager

 

actionUpdateQuantity

Quantity is updated only when the customer effectively place his order.

actionValidateOrder

 

actionWatermark

 

displayAdminCustomers

Launch modules when the tab AdminCustomers is displayed on back-office.

displayAdminOrder

Launch modules when the tab AdminOrder is displayed on back-office.

displayAdminStatsGraphEngine

 

displayAdminStatsGridEngine

 

displayAdminStatsModules

 

displayAttributeForm

Add fields to the form "attribute value"

displayAttributeGroupForm

Add fields to the form "attribute group"

displayAttributeGroupPostProcess

On post-process in admin attribute group

displayBackOfficeFooter

 

displayBackOfficeHeader

 

displayBackOfficeHome

 

displayBackOfficeTop

 

displayBeforeCarrier

This hook is display before the carrier list on Front office

displayBeforePayment

Redirect user to the module instead of displaying payment modules

displayCarrierList

 

displayCustomerAccount

Display on page account of the customer

displayCustomerAccountForm

Display some information on the form to create a customer account

displayCustomerAccountFormTop

 

displayFeatureForm

Add fields to the form "feature"

displayFeaturePostProcess

On post-process in admin feature

displayFeatureValueForm

Add fields to the form "feature value"

displayFeatureValuePostProcess

On post-process in admin feature value

displayFooter

Add block in footer

displayFooterProduct

Add new blocks under the product description

displayHeader

A hook which allow you to do things in the header of each pages

displayHome

 

displayInvoice

Add blocks to invoice (order)

displayLeftColumn

 

displayLeftColumnProduct

 

displayMyAccountBlock

Display extra information inside the "my account" block

displayMyAccountBlockfooter

Display extra information inside the "my account" block

displayOrderConfirmation

Called on order confirmation page

displayOrderDetail

Displayed on order detail on front office

displayPDFInvoice

Allow the display of extra information into the PDF invoice

displayPayment

 

displayPaymentReturn

 

displayPaymentTop

Top of payment page

displayProductButtons

Put new action buttons on product page

displayProductComparison

Extra Product Comparison

displayProductTab

Called on order product page tabs

displayProductTabContent

Called on order product page tabs

displayRightColumn

 

displayRightColumnProduct

 

displayShoppingCart

Display some specific information

displayShoppingCartFooter

Display some specific information on the shopping cart page

displayTop

A hook which enables you to do things at the top of each page.

Updated hooks

Most of these hooks are the same as they were in version 1.4 of PrestaShop, but have been renamed with either an "action" or "display" prefix in order to be compatible with the new 1.5 naming scheme.

Old hook name

New hook name

Hook description

AdminStatsModules

displayAdminStatsModules

 

GraphEngine

displayAdminStatsGraphEngine

 

GridEngine

displayAdminStatsGridEngine

 

PDFInvoice

displayPDFInvoice

Allow the display of extra information into the PDF invoice

addproduct

actionProductAdd

 

adminCustomers

displayAdminCustomers

Launch modules when the tab AdminCustomers is displayed on back-office.

adminOrder

displayAdminOrder

Launch modules when the tab AdminOrder is displayed on back-office.

afterCreateHtaccess

actionHtaccessCreate

After .htaccess creation

afterDeleteAttribute

actionAttributeDelete

On deleting attribute feature value

afterDeleteAttributeGroup

actionAttributeGroupDelete

On deleting attribute group

afterDeleteFeature

actionFeatureDelete

On deleting attribute feature

afterDeleteFeatureValue

actionFeatureValueDelete

On deleting attribute feature value

afterSaveAdminMeta

actionAdminMetaSave

After save configuration in AdminMeta

afterSaveAttribute

actionAttributeSave

On saving attribute feature value

afterSaveAttributeGroup

actionAttributeGroupSave

On saving attribute group

afterSaveFeature

actionFeatureSave

On saving attribute feature

afterSaveFeatureValue

actionFeatureValueSave

On saving attribute feature value

afterSaveProduct

actionProductSave

On saving products

attributeForm

displayAttributeForm

Add fields to the form "attribute value"

attributeGroupForm

displayAttributeGroupForm

Add fields to the form "attribute group"

authentication

actionAuthentication

 

backBeforePayment

displayBeforePayment

Redirect user to the module instead of displaying payment modules

backOfficeFooter

displayBackOfficeFooter

 

backOfficeHeader

displayBackOfficeHeader

 

backOfficeHome

displayBackOfficeHome

 

backOfficeTop

displayBackOfficeTop

 

beforeAuthentication

actionBeforeAuthentication

Before authentication

beforeCarrier

displayBeforeCarrier

This hook is display before the carrier list on Front office

cancelProduct

actionProductCancel

This hook is called when you cancel a product in an order

cart

actionCartSave

 

categoryAddition

actionCategoryAdd

 

categoryDeletion

actionCategoryDelete

 

categoryUpdate

actionCategoryUpdate

 

createAccount

actionCustomerAccountAdd

Called when a new customer successfully creates an account

createAccountForm

displayCustomerAccountForm

Display some information on the form to create a customer account

createAccountTop

displayCustomerAccountFormTop

 

customerAccount

displayCustomerAccount

Display on page account of the customer

deleteProductAttribute

actionProductAttributeDelete

 

deleteproduct

actionProductDelete

This hook is called when a product is deleted

extraCarrier

displayCarrierList

 

extraLeft

displayLeftColumnProduct

 

extraProductComparison

displayProductComparison

Extra Product Comparison

extraRight

displayRightColumnProduct

 

featureForm

displayFeatureForm

Add fields to the form "feature"

featureValueForm

displayFeatureValueForm

Add fields to the form "feature value"

footer

displayFooter

Add block in footer

header

displayHeader

A hook which allow you to do things in the header of each pages

home

displayHome

 

invoice

displayInvoice

Add blocks to invoice (order)

leftColumn

displayLeftColumn

 

myAccountBlock

displayMyAccountBlock

Display extra information inside the "my account" block

newOrder

actionValidateOrder

 

orderConfirmation

displayOrderConfirmation

Called on order confirmation page

orderDetail

actionOrderDetail

To set the follow-up in Smarty when order detail is called

orderDetailDisplayed

displayOrderDetail

Displayed on order detail on front office

orderReturn

actionOrderReturn

 

orderSlip

actionOrderSlipAdd

Called when a quantity of one product change in an order.

payment

displayPayment

 

paymentCCAdded

actionPaymentCCAdd

Payment CC added

paymentConfirm

actionPaymentConfirmation

 

paymentReturn

displayPaymentReturn

 

paymentTop

displayPaymentTop

Top of payment page

postProcessAttribute

actionAttributePostProcess

On post-process in admin feature value

postProcessAttributeGroup

displayAttributeGroupPostProcess

On post-process in admin attribute group

postProcessFeature

displayFeaturePostProcess

On post-process in admin feature

postProcessFeatureValue

displayFeatureValuePostProcess

On post-process in admin feature value

postUpdateOrderStatus

actionOrderStatusPostUpdate

 

processCarrier

actionCarrierProcess

 

productActions

displayProductButtons

Put new action buttons on product page

productListAssign

actionProductListOverride

Assign product list to a category

productOutOfStock

actionProductOutOfStock

Make action while product is out of stock

productTab

displayProductTab

Called on order product page tabs

productTabContent

displayProductTabContent

Called on order product page tabs

productfooter

displayFooterProduct

Add new blocks under the product description

rightColumn

displayRightColumn

 

search

actionSearch

 

shoppingCart

displayShoppingCartFooter

Display some specific information on the shopping cart page

shoppingCartExtra

displayShoppingCart

Display some specific information

taxManager

actionTaxManager

 

top

displayTop

A hook which allow you to do things at the top of each pages.

updateCarrier

actionCarrierUpdate

This hook is called when a carrier is updated

updateOrderStatus

actionOrderStatusUpdate

Launch modules when the order's status changes.

updateProductAttribute

actionProductAttributeUpdate

 

updateQuantity

actionUpdateQuantity

Quantity is updated only when the customer effectively place his order.

updateproduct

actionProductUpdate

 

watermark

actionWatermark

 

Front-office and back-office

Front-office hooks

Homepage and general website items

Hook name

File location

Visible

Description

header

header.php

No

Called between the HEAD tags. Ideal location for adding JavaScript and CSS files.

top

header.php

Yes

Called in the page's header.

leftColumn

header.php

Yes

Called when loading the left column.

rightColumn

footer.php

Yes

Called when loading the right column.

footer

footer.php

Yes

Called in the page's footer.

home

index.php

Yes

Called at the center of the homepage.

Product sheet

Hook name

File location

Visible

Description

extraLeft

product.php

Yes

Called right before the "Print" link, under the picture.

extraRight

product.php

Yes

Called right after the block for the "Add to Cart" button.

productActions

product.php

Yes

Called inside the block for the "Add to Cart" button, right after that button.

productOutOfStock

product.php

Yes

Called inside the block for the "Add to Cart" button, right after the "Availability" information.

productfooter

product.php

Yes

Called right before the tabs.

productTab

product.php

Yes

Called in tabs list, such as "More info", "Data sheet", "Accessories"... Ideal location for one more tab, the content of which is handled by the productTabContent hook.

productTabContent

product.php

Yes

Called when a tab is clicked. Ideal location for the content of a tab that has been defined using the productTab hook.

Cart

Hook name

File location

Visible

Description

cart

Class: Cart.php

No

Called right after a cart creation or update.

shoppingCart

order.php

Yes

Called right below the cart items table.

shoppingCartExtra

order.php

Yes

Called after the cart's table of items, right above the navigation buttons.

createAccountTop

authentication.php

Yes

Called within the client account creation form, right above the the "Your personal information" block.

createAccountForm

authentication.php

Yes

Called within the client account creation form, right before the "Register" button.

createAccount

authentication.php

No

Called right after the client account creation.

customerAccount

my-account.php

Yes

Called on the client account homepage, after the list of available links. Ideal location to add a link to this list.

myAccountBlock

Module: blockmyaccount.php

Yes

Called within the "My account" block, in the left column, below the list of available links. Ideal location to add a link to this list.

authentication

authentication.php

No

Called right after the client identification, only if the authentication is valid (e-mail address and password are both OK).

Hook name

File location

Visible

Description

search

Class: Search.php

No

Called after a search is performed. Ideal location to parse and/or handle the search query and results.

Carrier choice

Hook name

File location

Visible

Description

extraCarrier

order.php

Yes

Called after the list of available carriers, during the order process. Ideal location to add a carrier, as added by a module.

Payment

Hook name

File location

Visible

Description

payment

order.php

Yes

Called when needing to build a list of the available payment solutions, during the order process. Ideal location to enable the choice of a payment module that you have developed.

paymentReturn

order-confirmation.php

Yes

Called when the user is sent back to the store after having paid on the 3rd-party website. Ideal location to display a confirmation message or to give some details on the payment.

orderConfirmation

order-confirmation.php

Yes

A duplicate of paymentReturn.

backBeforePayment

order.php

No

Called when displaying the list of available payment solutions. Ideal location to redirect the user instead of displaying said list (i.e., 1-click PayPal checkout)..

Merchandise Returns

Hook name

File location

Visible

Description

orderReturn

order-follow.php

No

Called when the customer request to send his merchandise back to the store, and if now error occurs.

PDFInvoice

Class: PDF.php

Yes

Called when displaying the invoice in PDF format. Ideal location to display dynamic or static content within the invoice.

Back-office hooks

General

Hook name

File location

Visible

Description

backOfficeTop

header.inc.php

Yes

Called within the header, above the tabs.

backOfficeHeader

header.inc.php

No

Called between the HEAD tags. Ideal location for adding JavaScript and CSS files.

backOfficeFooter

footer.inc.php

Yes

Called within the page footer, above the "Power By PrestaShop" line.

backOfficeHome

index.php

Yes

Called at the center of the homepage.

Orders and order details

Hook name

File location

Visible

Description

newOrder

Class: PaymentModule.php

No

Called during the new order creation process, right after it has been created.

paymentConfirm

Class: Hook.php

No

Called when an order's status becomes "Payment accepted".

updateOrderStatus

Class: OrderHistory.php

No

Called when an order's status is changed, right before it is actually changed.

postUpdateOrderStatus

Class: OrderHistory.php

No

Called when an order's status is changed, right after it is actually changed.

cancelProduct

AdminOrders.php

No

Called when an item is deleted from an order, right after the deletion.

invoice

AdminOrders.php

Yes

Called when the order's details are displayed, above the Client Information block.

adminOrder

AdminOrders.php

Yes

Called when the order's details are displayed, below the Client Information block.

orderSlip

AdminOrders.php

No

Called during the creation of a credit note, right after it has been created.

Products

Hook name

File location

Visible

Description

addproduct

AdminProducts.php

No

Called when a product is created or duplicated, right after said creation/duplication.

updateproduct

AdminProducts.php

No

Called when a product is update with a new picture, right after said update.

deleteproduct

Class: Product.php

No

Called when a product is deleted, right before said deletion..

updateQuantity

Class: PaymentModule.php

No

Called during an the validation of an order, the status of which being something other than "canceled" or "Payment error", for each of the order's items.

updateProductAttribute

Class: Product.php

No

Called when a product declination is updated, right after said update.

watermark

AdminProducts.php

No

Called when an image is added to an product, right after said addition.

Statistics

Hook name

File location

Visible

Description

GraphEngine

Class: ModuleGraph.php

Yes

Called when a stats graph is displayed.

GridEngine

Module: GridEngine.php

Yes

Called when the grid of stats is displayed.

AdminStatsModules

AdminStatsTab.php

Yes

Called when the list of stats modules is displayed.

Clients

Hook name

File location

Visible

Description

adminCustomers

AdminCustomers.php

Yes

Called when a client's details are displayed, right after the list of the clients groups the current client belongs to.

Carriers

Hook name

File location

Visible

Description

updateCarrier

AdminCarriers.php

No

Called during a carrier's update, right after said update.

  • No labels