Child pages
  • Hooks in PrestaShop 1.5

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 8

...

Front-office and back-office

...

Existing front-office hooks

...

Home page and general

...

site pages

Hook name

File location

Visible

Description

header

header.php

No

Called between the HEAD displayHeaderCalled within the HTML <head> tags. Ideal location for adding JavaScript and CSS files.

top

header.php

Yes

displayTopCalled in the page's header.

leftColumn

header.php

Yes

displayLeftColumnCalled when loading the left column.

rightColumn

footer.php

Yes

displayRightColumnCalled when loading the right column.

footer

footer.php

Yes

displayFooterCalled in the page's footer.

home

index.php

Yes

displayHomeCalled at the center of the homepage.

Product

...

page

Hook name

File location

Visible

Description

extraLeft

product.php

Yes

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

extraRight

product.php

Yes

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

productActions

product.php

Yes

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

productOutOfStock

product.php

Yes

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

productfooter

product.php

Yes

displayFooterProductCalled right before the tabs.

productTab

product.php

Yes

displayProductTabCalled 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

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

Cart page

Hook name

File location

Visible

Description

cart

Class: Cart.php

No

actionCartSaveCalled right after a cart creation or update.

shoppingCart

order.php

Yes

displayShoppingCartFooterCalled right below the cart items table.

shoppingCartExtra

order.php

Yes

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

createAccountTop

authentication.php

Yes

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

createAccountForm

authentication.php

Yes

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

createAccount

authentication.php

No

actionCustomerAccountAddCalled right after the client account creation.

customerAccount

my-account.php

Yes

displayCustomerAccountCalled 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

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

authentication

authentication.php

NodisplayMyAccountBlockfooterDisplays extra information inside the "My account" block.
actionAuthenticationCalled right after the client identification, only if the authentication is valid (e-mail address and password are both OK).
actionBeforeAuthenticationCalled right before authentication.

Search page

Hook name

File location

Visible

Description

search

Class: Search.php

No

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

Carrier choice page

Hook name

File location

Visible

Description

extraCarrier

order.php

YesdisplayBeforeCarrierDisplayed before the carrier list on front-office.
displayCarrierListCalled after the list of available carriers, during the order process. Ideal location to add a carrier, as added by a module.

Payment page

Hook nameFile locationDescriptionVisible
displayPaymentTop

Description

payment

order.php

YesTop of payment page.
displayPaymentCalled 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

displayPaymentReturnCalled 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

displayOrderConfirmationA duplicate of paymentReturn.

backBeforePayment

order.php

No

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

...

Order page

Hook name

File location

Visible

Description

orderReturn

order-follow.php

No

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

PDFInvoice

Class: PDF.php

Yes

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

...

Existing back-office hooks

General hooks

Hook name

File location

Visible

Description

backOfficeTop

header.inc.php

Yes

displayBackOfficeTopCalled within the header, above the tabs.

backOfficeHeader

header.inc.php

No

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

backOfficeFooter

footer.inc.php

Yes

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

backOfficeHome

index.php

Yes

displayBackOfficeHomeCalled at the center of the homepage.

Orders and order details

Hook name

File location

Visible

Description

newOrder

Class: PaymentModule.php

No

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

paymentConfirm

Class: Hook.php

No

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

updateOrderStatus

Class: OrderHistory.php

No

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

postUpdateOrderStatus

Class: OrderHistory.php

No

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

cancelProduct

AdminOrders.php

No

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

invoice

AdminOrders.php

Yes

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

adminOrder

AdminOrders.php

Yes

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

orderSlip

AdminOrders.php

No

actionOrderSlipAddCalled 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 actionProductSaveCalled when saving products.
actionUpdateQuantityCalled 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

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

watermark

AdminProducts.php

NoactionProductAttributeDeleteCalled when a product declination is deleted.
actionWatermarkCalled when an image is added to an a product, right after said addition.

Statistics

Hook name

File location

Visible

Description

GraphEngine

Class: ModuleGraph.php

Yes

Called when 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

Hook nameDescription
displayAdminStatsGraphEngineCalled when a stats graph is displayed.

GridEngine

Module: GridEngine.php

Yes

displayAdminStatsGridEngineCalled when the grid of stats is displayed.

AdminStatsModules

AdminStatsTab.php

Yes

displayAdminStatsModulesCalled when the list of stats modules is displayed.

Clients

Hook name

File location

Visible

Description

adminCustomers

AdminCustomers.php

Yes

displayAdminCustomersCalled 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

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