Child pages
  • Hooks in PrestaShop 1.5

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Front-office and back-office

...

Front-office hooks

...

Homepage and general

...

website items

Hook name

File location

Visible

Description

displayHeaderCalled within the HTML <head>

header

header.php

No

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

displayTop

top

header.php

Yes

Called in the page's header.

displayLeftColumn

leftColumn

header.php

Yes

Called when loading the left column.

displayRightColumn

rightColumn

footer.php

Yes

Called when loading the right column.

displayFooter

footer

footer.php

Yes

Called in the page's footer.

displayHome

home

index.php

Yes

Called at the center of the homepage.

Product

...

sheet

Hook name

File location

Visible

Description

displayLeftColumnProduct

extraLeft

product.php

Yes

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

displayRightColumnProduct

extraRight

product.php

Yes

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

displayProductButtons

productActions

product.php

Yes

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

actionProductOutOfStock

productOutOfStock

product.php

Yes

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

displayFooterProduct

productfooter

product.php

Yes

Called right before the tabs.

displayProductTab

productTab

product.php

Yes

Called in tabs list, such as "More info", "Data sheet", "Accessories"

, etc.
displayProductTabContent

... 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

actionCartSave

cart

Class: Cart.php

No

Called right after a cart creation or update.

displayShoppingCartFooter

shoppingCart

order.php

Yes

Called right below the cart items table.

displayShoppingCart

shoppingCartExtra

order.php

Yes

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

displayCustomerAccountFormTop

createAccountTop

authentication.php

Yes

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

displayCustomerAccountForm

createAccountForm

authentication.php

Yes

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

actionCustomerAccountAdd

createAccount

authentication.php

No

Called right after the client account creation.

displayCustomerAccount

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.

displayMyAccountBlock

myAccountBlock

Module: blockmyaccount.php

Yes

Called within the "My account" block, in the left column, below the list of available links.

This is the ideal

Ideal location to add a link to this list.

displayMyAccountBlockfooterDisplays extra information inside the "My account" block.
actionAuthentication

authentication

authentication.php

No

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

actionBeforeAuthenticationCalled right before authentication.

...

Carrier choice

...

Hook name

File location

Visible

Description

displayBeforeCarrierDisplayed before the carrier list on front-office.
displayCarrierList

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

displayPaymentTopTop of payment page.
displayPayment

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.

displayPaymentReturn

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.

displayOrderConfirmation

orderConfirmation

order-confirmation.php

Yes

A duplicate of paymentReturn.

displayBeforePayment

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

actionOrderReturn

orderReturn

order-follow.php

No

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

displayPDFInvoice

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

displayBackOfficeTop

backOfficeTop

header.inc.php

Yes

Called within the header, above the tabs.

displayBackOfficeHeader

backOfficeHeader

header.inc.php

No

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

displayBackOfficeFooter

backOfficeFooter

footer.inc.php

Yes

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

displayBackOfficeHome

backOfficeHome

index.php

Yes

Called at the center of the homepage.

Orders and order details

Hook name

File location

Visible

Description

actionValidateOrder

newOrder

Class: PaymentModule.php

No

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

actionPaymentConfirmation

paymentConfirm

Class: Hook.php

No

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

actionOrderStatusUpdate

updateOrderStatus

Class: OrderHistory.php

No

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

actionOrderStatusPostUpdate

postUpdateOrderStatus

Class: OrderHistory.php

No

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

actionProductCancel

cancelProduct

AdminOrders.php

No

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

displayInvoice

invoice

AdminOrders.php

Yes

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

displayAdminOrder

adminOrder

AdminOrders.php

Yes

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

actionOrderSlipAdd

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

actionProductSaveCalled when saving products.
actionUpdateQuantityCalled

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.

actionProductAttributeUpdate

updateProductAttribute

Class: Product.php

No

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

actionProductAttributeDeleteCalled when a product declination is deleted.
actionWatermark

watermark

AdminProducts.php

No

Called when an image is added to

a

an product, right after said addition.

displayAttributeFormAdd fields to the form "attribute value".
displayAttributeGroupFormAdd fields to the form "attribute group".
displayAttributeGroupPostProcessCalled when post-process in admin attribute group.
displayFeatureFormAdd fields to the form "feature".
displayFeaturePostProcessCalled when post-process in admin feature.
displayFeatureValueFormAdd fields to the form "feature value".
displayFeatureValuePostProcessCalled when post-process in admin feature value.

Statistics

...

Statistics

Hook name

File location

Visible

Description

GraphEngine

Class: ModuleGraph.php

Yes

Called when a stats graph is displayed.

displayAdminStatsGridEngine

GridEngine

Module: GridEngine.php

Yes

Called when the grid of stats is displayed.

displayAdminStatsModules

AdminStatsModules

AdminStatsTab.php

Yes

Called when the list of stats modules is displayed.

Clients

Hook name

File location

Visible

Description

displayAdminCustomers

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

actionCarrierUpdate

updateCarrier

AdminCarriers.php

No

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