...
Home page and general site pages
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayHeader | Called within the HTML <head> tags. Ideal location for adding JavaScript and CSS files. | N/A |
displayTop | Called in the page's header. | N/A |
displayLeftColumn | Called when loading the left column. | N/A |
displayRightColumn | Called when loading the right column. | array(
'cart' => (object) Cart object
);
Note that the Cart object can also be retrieved from the current Context. |
displayFooter | Called in the page's footer. | N/A |
displayHome | Called at the center of the homepage. | N/A |
Product page
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayLeftColumnProduct | Called right before the "Print" link, under the picture. | N/A |
displayRightColumnProduct | Called right after the block for the "Add to Cart" button. | N/A |
displayProductButtons | Called inside the block for the "Add to Cart" button, right after that button. | N/A |
actionProductOutOfStock | Called inside the block for the "Add to Cart" button, right after the "Availability" information. | N/A |
displayFooterProduct | Called right before the tabs. | N/A |
displayProductTab | Called in tabs list, such as "More info", "Data sheet", "Accessories", etc. | N/A |
displayProductTabContent | Called when a tab is clicked. | array(
'product' => (object) Product object
);
|
Cart page
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
actionCartSave | Called right after a cart creation or update. | N/A |
displayShoppingCartFooter | Called right below the cart items table. | array( 'delivery' => $delivery, 'delivery_state' => State::getNameById($delivery->id_state), 'invoice' => $invoice, 'invoice_state' => State::getNameById($invoice->id_state), 'formattedAddresses' => $formatted_addresses, 'products' => array_values($products), 'gift_products' => $gift_products, 'discounts' => $cart_rules, 'is_virtual_cart' => (int)$this->isVirtualCart(), 'total_discounts' => $total_discounts, 'total_discounts_tax_exc' => $total_discounts_tax_exc, 'total_wrapping' => $this->getOrderTotal(true, Cart::ONLY_WRAPPING), 'total_wrapping_tax_exc' => $this->getOrderTotal(false, Cart::ONLY_WRAPPING), 'total_shipping' => $total_shipping, 'total_shipping_tax_exc' => $total_shipping_tax_exc, 'total_products_wt' => $total_products_wt, 'total_products' => $total_products, 'total_price' => $base_total_tax_inc, 'total_tax' => $total_tax, 'total_price_without_tax' => $base_total_tax_exc, 'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1), 'free_ship' => $total_shipping ? 0 : 1, 'carrier' => new Carrier($this->id_carrier, $id_lang), ); Can be found in /classes/Cart.php |
displayShoppingCart | Called after the cart's table of items, right above the navigation buttons. | array( 'delivery' => $delivery, 'delivery_state' => State::getNameById($delivery->id_state), 'invoice' => $invoice, 'invoice_state' => State::getNameById($invoice->id_state), 'formattedAddresses' => $formatted_addresses, 'products' => array_values($products), 'gift_products' => $gift_products, 'discounts' => $cart_rules, 'is_virtual_cart' => (int)$this->isVirtualCart(), 'total_discounts' => $total_discounts, 'total_discounts_tax_exc' => $total_discounts_tax_exc, 'total_wrapping' => $this->getOrderTotal(true, Cart::ONLY_WRAPPING), 'total_wrapping_tax_exc' => $this->getOrderTotal(false, Cart::ONLY_WRAPPING), 'total_shipping' => $total_shipping, 'total_shipping_tax_exc' => $total_shipping_tax_exc, 'total_products_wt' => $total_products_wt, 'total_products' => $total_products, 'total_price' => $base_total_tax_inc, 'total_tax' => $total_tax, 'total_price_without_tax' => $base_total_tax_exc, 'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1), 'free_ship' => $total_shipping ? 0 : 1, 'carrier' => new Carrier($this->id_carrier, $id_lang), ); Can be found in /classes/Cart.php |
displayCustomerAccountFormTop | Called within the client account creation form, right above the "Your personal information" block. | N/A |
displayCustomerAccountForm | Called within the client account creation form, right before the "Register" button. | N/A |
actionCustomerAccountAdd | Called right after the client account creation. | N/A |
displayCustomerAccount | Called on the client account homepage, after the list of available links. Ideal location to add a link to this list. | N/A |
displayMyAccountBlock | Called within the "My account" block, in the left column, below the list of available links. This is the ideal location to add a link to this list. | N/A |
displayMyAccountBlockfooter | Displays extra information inside the "My account" block. | N/A |
actionAuthentication | Called right after the client identification, only if the authentication is valid (e-mail address and password are both OK). | N/A |
actionBeforeAuthentication | Called right before authentication. | N/A |
Search page
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
actionSearch | Called after a search is performed. Ideal location to parse and/or handle the search query and results. | array(
'expr' => (string) Search query,
'total' => (int) Amount of search results
);
|
Carrier choice page
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayBeforeCarrier | Displayed before the carrier list on front-office. | array( 'carriers' => array( array( 'name' => (string) Name, 'img' => (string) Image URL, 'delay' => (string) Delay text, 'price' => (float) Total price with tax, 'price_tax_exc' => (float) Total price without tax, 'id_carrier' => (int) intified option delivery identifier, 'id_module' => (int) Module ID )), 'checked' => (int) intified selected carriers, 'delivery_option_list' => array(array( 0 => array( // First address '12,' => array( // First delivery option available for this address carrier_list => array( 12 => array( // First carrier for this option 'instance' => Carrier Object, 'logo' => <url to the carrier's logo>, 'price_with_tax' => 12.4, // Example 'price_without_tax' => 12.4, // Example 'package_list' => array( 1, // Example 3, // Example ), ), ), is_best_grade => true, // Does this option have the biggest grade (quick shipping) for this shipping address is_best_price => true, // Does this option have the lower price for this shipping address unique_carrier => true, // Does this option use a unique carrier total_price_with_tax => 12.5, total_price_without_tax => 12.5, position => 5, // Average of the carrier position ), ), )), 'delivery_option' => array( '<id_address>' => Delivery option, ... ) ); NOTE: intified means an array of integers 'intified' by Cart::intifier |
displayCarrierList | Called after the list of available carriers, during the order process. Ideal location to add a carrier, as added by a module. | array(
'address' => (object) Address object
);
|
Payment page
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayPaymentTop | Top of payment page. | N/A |
displayPayment | 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. | N/A |
displayPaymentReturn | 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. | array(
'total_to_pay' => (float) Total amount with tax,
'currency' => (string) Currency sign,
'objOrder' => (object) Order object,
'currencyObj' => (object) Currency object
);
|
displayOrderConfirmation | A duplicate of paymentReturn. | array(
'total_to_pay' => (float) Total amount with tax,
'currency' => (string) Currency sign,
'objOrder' => (object) Order object,
'currencyObj' => (object) Currency object
);
|
displayBeforePayment | 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). | array(
'module' => (string) Module link [e.g. /module/test/front]
);
|
Order page
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
actionOrderReturn | Called when the customer request to send his merchandise back to the store, and if now error occurs. | array(
'orderReturn' => (object) OrderReturn object
);
|
displayPDFInvoice | Called when displaying the invoice in PDF format. Ideal location to display content within the invoice. | N/A |
Mobile theme hooks
All these hooks are specific to PrestaShop's default mobile theme.
...
General hooks
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayBackOfficeTop | Called within the header, above the tabs. | N/A |
displayBackOfficeHeader | Called between the HEAD tags. Ideal location for adding JavaScript and CSS files. | N/A |
displayBackOfficeFooter | Called within the page footer, above the "Power By PrestaShop" line. | N/A |
displayBackOfficeHome | Called at the center of the homepage. | N/A |
Orders and order details
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
actionValidateOrder | Called during the new order creation process, right after it has been created. | array(
'cart' => (object) Cart object,
'order' => (object) Order object,
'customer' => (object) Customer object,
'currency' => (object) Currency object,
'orderStatus' => (object) OrderState object
);
|
actionPaymentConfirmation | Called when an order's status becomes "Payment accepted". | array(
'id_order' => (int) Order ID
);
|
actionOrderStatusUpdate | Called when an order's status is changed, right before it is actually changed. | array(
'newOrderStatus' => (object) OrderState object,
'id_order' => (int) Order ID
);
|
actionOrderStatusPostUpdate | Called when an order's status is changed, right after it is actually changed. | array(
'newOrderStatus' => (object) OrderState object, 'id_order' => (int) Order ID );
|
actionProductCancel | Called when an item is deleted from an order, right after the deletion. | array( 'order' => (object) Order object, 'id_order_detail' => (int) Order Detail ID ); |
displayInvoice | Called when the order's details are displayed, above the Client Information block. | N/A |
displayAdminOrder | Called when the order's details are displayed, below the Client Information block. | array( 'id_order' = (int) Order ID ); |
actionOrderSlipAdd | Called during the creation of a credit note, right after it has been created. | array(
'order' => Order oject,
'productList' => array(
(int) product ID 1, (int) product ID 2, ..., (int) product ID n
),
'qtyList' => array(
(int) quantity 1, (int) quantity 2, ...,
(int) quantity n
)
);
The order of IDs and quantities is important! |
Products
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
actionProductSave | Called when saving products. | array( 'id_product' => (int) Product ID ); |
actionUpdateQuantity | 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. | array(
'id_product' => (int) Product ID,
'id_product_attribute' => (int) Product attribute ID,
'quantity' => (int) New product quantity
);
|
actionProductAttributeUpdate | Called when a product declination is updated, right after said update. | array( 'id_product_attribute' => (int) Product attribute ID ); |
actionProductAttributeDelete | Called when a product declination is deleted. | array( 'product' => (object) Product object ); |
actionWatermark | Called when an image is added to a product, right after said addition. | array(
'id_image' => (int) Image ID,
'id_product' => (int) Product ID
);
|
displayAttributeForm | Add fields to the form "attribute value". | N/A |
displayAttributeGroupForm | Add fields to the form "attribute group". | N/A |
displayAttributeGroupPostProcess | Called when post-process in admin attribute group. | N/A |
displayFeatureForm | Add fields to the form "feature". | N/A |
displayFeaturePostProcess | Called when post-process in admin feature. | N/A |
displayFeatureValueForm | Add fields to the form "feature value". | N/A |
displayFeatureValuePostProcess | Called when post-process in admin feature value. | N/A |
Statistics
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayAdminStatsGraphEngine | Called when a stats graph is displayed. | N/A |
displayAdminStatsGridEngine | Called when the grid of stats is displayed. | N/A |
displayAdminStatsModules | Called when the list of stats modules is displayed. | N/A |
Clients
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
displayAdminCustomers | Called when a client's details are displayed, right after the list of the clients groups the current client belongs to. | N/A |
Carriers
Hook name | Description | What to expect in $params ? (Pseudocode) |
---|
actionCarrierUpdate | Called during a carrier's update, right after said update. | array(
'id_carrier' => (int) Current Carrier ID,
'carrier' => (object) New Carrier object
);
|