PrestaShop 1.6 Module Hooks

In PrestaShop 1.6, modules can use hooks to execute code after various actions occur and add additional code to display in various places in the Front Office and Back Office. Hooks can be viewed on the Modules > Positions tab in the Back Office. The hooks are listed alphabetically by name in the Back Office and have a brief description.

Hooks starting with action are executed before or after an action has occurred. Hooks starting with display and used to add additional code to TPL files in the theme. By default, only the hooks with a Position of 1 are displayed on the Positions subtab of the Modules tab. To view all hooks, tick the Display non-positionable hooks checkbox.

To call a hook, use the code Hook::exec('name'), where name is from the Name column below. In PrestaShop, it is convention to put the code generated by the hook in a variable called HOOK_NAME. For example, the code to call all the modules in the Homepage content hook and then pass them into a TPL is $this->context->smarty->assign('HOOK_HOME' => Hook::exec('displayHome'));.

Here's a list of all the module hooks available in PrestaShop v1.6 along with descriptions of what they can be used for and the parameters available to them. Parameters can be accessed like this: function hookDisplayFooterProduct($params) { $product = $params['product']; }

Name Description Parameters
actionAdmin<Action>Before Called before the specified action is performed by a Back Office controller controller
actionAdmin<Action>After Called after the specified action is performed by a Back Office controller controller, return
actionAdmin<Class><Action>Before Called before the specified action in the specified class is performed by a Back Office controller controller
actionAdmin<Class><Action>After Called after the specified action in the specified class is performed by a Back Office controller controller, return
actionAdminControllerSetMedia Called after adding media to the Back Office header  
actionAdminLoginControllerSetMedia Called after adding media to the Back Office login page header  
actionAdminMetaSave Called after saving Preferences > SEO & URLs tab  
actionAttributeDelete Called while deleting a product attribute id_attribute
actionAttributeGroupDelete Called while deleting a product attribute group id_attribute_group
actionAttributeGroupSave Called while saving a product attribute group id_attribute_group
actionAttributePostProcess Called on post-process of product attributes id_attribute
actionAttributeSave Called while saving a product attribute id_attribute
actionAuthentication Called after a customer successfully signs in customer
actionBeforeAjaxDie Called before the results of an AJAX request are displayed controller, method, value
actionBeforeAjaxDie<Controller><Method> Called before the results of an AJAX request for the specified controller and method are displayed controller, method, value
actionBeforeAuthentication Called after a customer begins authentication  
actionBeforeCartUpdateQty Called before the quantity of a cart product is updated cart, product, id_product_attribute, id_customization, quantity, operator, id_address_delivery, shop, auto_add_cart_rule
actionCarrierProcess Called when the carrier changes during checkout cart
actionCarrierUpdate Called when a carrier is updated in the Back Office id_carrier (current), carrier (new)
actionCartSave Called when a product is added to the cart or the cart's contents are modified  
actionCartSummary Called to add variables to the cart summary delivery, delivery_state, invoice, invoice_state, formattedAddresses, products, gift_products, discounts, is_virtual_cart, total_discounts, total_discounts_tax_exc, total_wrapping, total_wrapping_tax_exc, total_shipping, total_shipping_tax_exc, total_products_wt, total_products, total_price, total_tax, total_price_without_tax, is_multi_address_delivery, free_ship, carrier
actionCategoryAdd Called when a product category is created category
actionCategoryDelete Called when a product category is deleted category, delete_children
actionCategoryUpdate Called when a product category is modified category
action<Controller>ListingFieldsModifier Called to modify the listing query and fields for the specified controller select (modifiable), join (modifiable), where (modifiable), group_by (modifiable), order_by (modifiable), order_way (modifiable), fields (modifiable)
action<Controller>ListingResultsModifier Called to modify the listing results for the specified controller list (modifiable), list_total (modifiable)
action<Controller>FormModifier Called to modify the form fields and values for the specified controller fields (modifiable), fields_value (modifiable), form_vars (modifiable)
action<Controller>OptionsModifier Called to modify the option fields and values for the specified controller options (modifiable), option_vars (modifiable)
actionCronJob Used to add a cron job
actionCustomerAccountAdd Called when a new customer successfully creates an account _POST, newCustomer
actionCustomerLogoutBefore Called before a customer logs out customer
actionCustomerLogoutAfter Called after a customer logs out customer
actionDeliveryPriceByPrice Called to override the delivery price by price id_carrier, order_total, id_zone
actionDeliveryPriceByWeight Called to override the delivery price by weight id_carrier, total_weight, id_zone
actionDispatcher Called before running a controller controller_type, controller_class, is_module
actionEmailAddAfterContent Called just after fetching a mail template template, template_html (modifiable), template_txt (modifiable), id_lang
actionEmailAddBeforeContent Called just before fetching a mail template template, template_html (modifiable), template_txt (modifiable), id_lang
actionFeatureDelete Called while deleting a product feature id_feature
actionFeatureSave Called while saving a product feature id_feature
actionFeatureValueDelete Called while deleting a product feature value id_feature_value
actionFeatureValueSave Called while saving a product feature value id_feature_value
actionGetExtraMailTemplateVars Called to add template variables to emails template, template_vars, extra_template_vars (modifiable), id_lang
actionGetIDZoneByAddressID Used to override the zone for an address id_address
actionHtaccessCreate Called after writing the .htaccess access  
actionInvoiceNumberFormatted Called to override the formatted invoice number id_lang, id_shop, number
actionModuleInstallAfter Called after installing a module object
actionModuleInstallBefore Called before installing a module object
actionModuleRegisterAfter Called after a module hook is registered object, hook_name
actionModuleRegisterBefore Called before a module hook is registered object, hook_name
actionModuleUnRegisterAfter Called after a module hook is unregistered object, hook_name
actionModuleUnRegisterBefore Called before a module hook is unregistered object, hook_name
actionObjectAddBefore Called before any object is added object
actionObject<Class>AddBefore Called before any object of the specified class is added object
actionObjectAddAfter Called after any object is added object
actionObject<Class>AddAfter Called after any object of the specified class is added object
actionObjectUpdateBefore Called before any object is updated object
actionObject<Class>UpdateBefore Called before any object of the specified class is updated object
actionObjectUpdateAfter Called after any object is updated object
actionObject<Class>UpdateAfter Called after any object of the specified class is updated object
actionOrderDetail Called before displaying order details carrier, order
actionOrderEdited Called when an order is edited order
actionOrderReturn Called when a customer returns a product orderReturn
actionOrderSlipAdd Called when a credit slip is created order, productList, qtyList
actionOrderStatusPostUpdate Called after the status of an order changes newOrderStatus, id_order
actionOrderStatusUpdate Called before the status of an order changes newOrderStatus, id_order
actionPaymentCCAdd Called after an order payment is added paymentCC
actionPaymentConfirmation Called after the order payment is validated id_order
actionPDFInvoiceRender Called before the PDF invoice is rendered order_invoice_list
actionProductAdd Called after a product is created id_product, product
actionProductAttributeDelete Called after a product combination is deleted id_product_attribute, deleteAllAttributes
actionProductAttributeUpdate Called after a product combination is updated id_product_attribute
actionProductCancel Called after cancelling a product in an order order, id_order_detail
actionProductCoverage Called when the quantity of a product is reduced from a warehouse id_product, id_product_attribute, warehouse
actionProductDelete Called while a product is deleted id_product
actionProductListOverride Used to modify the product list on category pages nbProducts (modifiable), catProducts (modifiable), hookExecuted (modifiable)
actionProductOutOfStock Used to add buttons in product.tpl when a product is out of stock product
actionProductSave Called while saving products id_product, product
actionProductUpdate Called after a product has been updated id_product, product
actionSearch Called after a product search has been performed expr, total
actionSetInvoice Called to modify the invoice number Order, OrderInvoice, use_existing_payment
actionShopDataDuplication Called when duplicating a shop old_id_shop, new_id_shop
actionTaxManager Called when calculating product tax  
actionUpdateQuantity Called when a product quantity is updated id_product, id_product_attribute, quantity, id_shop
actionValidateOrder Called when an order is validated by a payment module cart, order, customer, currency, order_status
actionWatermark Called to add a watermark to a product image id_image, id_product
dashboardZoneOne Used to add a module to the left column of the dashboard date_from, date_to
dashboardZoneTwo Used to add a module to the right column of the dashboard date_from, date_to
displayAdminCustomers Used to add a block when viewing a customer in the Back Office id_customer
displayAdminOrder Used to add a block above the products block when viewing an order in the Back Office id_order
displayAdminOrderContentOrder Used to add a new tab content before the Status tab when viewing an order in the Back Office order, products, customer
displayAdminOrderContentShip Used to add a new tab content before the Shipping Address tab when viewing an order in the Back Office order, products, customer
displayAdminOrderTabOrder Used to add a tab before the Status tab when viewing an order in the Back Office order, products, customer
displayAdminOrderTabShip Used to add a tab before the Shipping Address tab when viewing an order in the Back Office order, products, customer
displayAdminProductsExtra Used to add a tab to the product editor in the Back Office
displayAdminStatsGraphEngine Used to add a new graph engine when rendering stats  
displayAdminStatsGridEngine Used to add a new grid engine when rendering stats  
displayAdminStatsModules Used to add a new subtab to the Stats tab in the Back Office  
displayAttributeForm Used to add a new field when editing product attributes id_attribute
displayAttributeGroupForm Used to add a new field when editing product attribute groups id_attribute_group
displayAttributeGroupPostProcess Used to add code to post-process when saving product attribute groups errors (modifiable)
displayBackOfficeCategory Used by the "Categories block" module to add category thumbnails when editing categories  
displayBackOfficeFooter Used to add content to the right side of the Back Office footer  
displayBackOfficeHeader Used to add media to the <head> tag in the Back Office  
displayBackOfficeHome Used to add content to the Back Office homepage  
displayBackOfficeTop Used to add content to the right side of the Back Office header  
displayBeforeCarrier Used to add content before the carrier list in the Front Office carriers
displayBeforePayment Used to redirect to a module instead of displaying payment modules module
displayCarrierList Used to add extra carriers on the checkout page address
displayCartExtraProductActions Used to add extra products on each product in the shopping cart product
displayCustomerAccount Used to add links to the customer account page  
displayCustomerAccountForm Used to add fields to the bottom of customer registration form in the Front Office  
displayCustomerAccountFormTop Used to add fields to the top of the customer registration form in the Front Office  
displayCustomerIdentityForm Used to add fields to the bottom of the customer's personal information page in the Front Office  
displayFeatureForm Used to add fields when editing product features id_feature
displayFeaturePostProcess Used to add code to post-process when saving product features errors (modifiable)
displayFeatureValueForm Used to add fields when editing product feature values id_feature_value
displayFeatureValuePostProcess Used to add code to post-process when saving product feature values errors (modifiable)
displayFooter Used to add blocks to the footer in the Front Office  
displayFooterProduct Used to add blocks on the product page under the description product, category
displayHome Used to add blocks to the homepage in the Front Office  
displayHomeTab Used to add a new tab to the homepage in the Front Office  
displayHomeTabContent Used to add a new tab content to the homepage in the Front Office  
displayInvoice Used to add content to the top of the order page in the Back Office id_order
displayInvoiceLegalFreeText Used to modify the legal free text on PDF invoices id_order
displayLeftColumn Used to add blocks to the left column in the Front Office  
displayLeftColumnProduct Used to add content to the left column of the product page in the Front Office  
displayMaintenance Used to add content below the logo on the maintenance page  
displayMyAccountBlock Used to add links to the "My account block" in the left or right column  
displayNav Used to add content to the navigation bar at the top of the Front Office  
displayOrderConfirmation Called before the order confirmation page is displayed total_to_pay, currency, objOrder, currencyObj
displayOrderDetail Used to add content above the products in the order detail in the Front Office order
displayOverrideTemplate Used to override the template of the current Front Office controller controller
displayPayment Used to add a payment method to the checkout page  
displayPaymentReturn Used to add code before the payment return page is displayed total_to_pay, currency, objOrder, currencyObj
displayPaymentTop Used to add content to the top of the payment page  
displayPDFInvoice Used to add content to the bottom of PDF invoices object
displayProductButtons Used to add action buttons to the product page in the Front Office product
displayProductComparison Used to add content to the bottom of the product comparison in the Front Office list_ids_product
displayProductListFunctionalButtons Used to add buttons to each product in listings in the Front Office product
displayProductTab Used to add a new tab to the product page in the Front Office product
displayProductTabContent Used to add a new tab content to the product page in the Front Office product
displayRightColumn Used to add blocks to the right column in the Front Office cart
displayRightColumnProduct Used to add content to the right column of the product page in the Front Office  
displayShoppingCart Used to add additional action buttons to the shopping cart on the checkout page delivery, delivery_state, invoice, invoice_state, formattedAddresses, products, gift_products, discounts, is_virtual_cart, total_discounts, total_discounts_tax_exc, total_wrapping, total_wrapping_tax_exc, total_shipping, total_shipping_tax_exc, total_products_wt, total_products, total_price, total_tax, total_price_without_tax, is_multi_address_delivery, free_ship, carrier
displayShoppingCartFooter Used to add content below the shopping cart on the checkout page delivery, delivery_state, invoice, invoice_state, formattedAddresses, products, gift_products, discounts, is_virtual_cart, total_discounts, total_discounts_tax_exc, total_wrapping, total_wrapping_tax_exc, total_shipping, total_shipping_tax_exc, total_products_wt, total_products, total_price, total_tax, total_price_without_tax, is_multi_address_delivery, free_ship, carrier
displayTop Used to add content to the top of the page in the Front Office  
displayTopColumn Used to add content to the top of the center column in the Front Office  
Header Used to add media to the <head> tag in the Front Office  
updateProduct Called after updating a product through the Webservice id_product