LogoLogo
Homepage
  • Documentations for PrestaShop 1.5
  • English documentation 1.5
    • About PrestaShop 1.5
    • New features in PrestaShop 1.5
    • Getting Started
      • What you need to get started
      • Installing PrestaShop
      • Installing PrestaShop using the command line
      • Updating & Uninstalling
      • Misc. information
    • Updating PrestaShop
      • Automatic update
      • Manual update
      • Making and restoring your own backup
      • In case of issues
    • User Guide
      • Training
      • Customizing your shop
      • Browsing the front-office
      • Connecting to the PrestaShop back-office
      • First steps with PrestaShop 1.5
      • Adding Products and Product Categories
      • A Look Inside the Catalog
      • Managing Orders
      • Managing Customers
      • Creating Price Rules and Vouchers
      • Managing Shipping
      • Understanding Local Settings
      • Managing Modules and Themes
      • Making the Native Modules Work
      • Understanding the Preferences
      • Understanding the Advanced Parameters
      • Administering the Back-Office
      • Understanding Statistics
      • Advanced Stock Management
      • Managing Multiple Shops
    • Developer Guide
      • Developer tutorials
        • Using the PrestaShop Web Service
          • Webservice one-page documentation
          • Chapter 1 - Creating Access to Back Office
          • Chapter 2 - Discovery - Testing access to the web service with the browser
          • Chapter 3 - First steps - Access the Web service and list client
          • Chapter 4 - Retrieve Data - Retrieving a Client
          • Chapter 5 - Modification - Update client
          • Chapter 6 - Creation - Remote Online Form
          • Chapter 7 - Removal - Remove customer accounts from the database
          • Chapter 8 - Advanced Use
          • Chapter 9 - Image management
          • Chapter 10 - Price management
          • Cheat-sheet - Concepts outlined in this tutorial
          • Web service reference
        • Helpers
          • HelperForm
          • HelperOptions
          • HelperList
          • Using helpers to overload a back-office template
        • New Developers Features In PrestaShop 1.5
        • Using the Context Object
        • DB class best practices
        • Public and overloadable methods
        • Overriding default behaviors
        • Using addJquery(), addJqueryPlugin() and addJqueryUI()
        • Handling special characters in links
        • Auto-updating modules
        • Front-Office Controllers
        • Controllers correspondence table
        • Specifics of multistore module development
        • Developer tips and tricks
        • PrestaShop's developer tools
        • Using the backward compatibility toolkit
      • Fundamentals
      • Coding Standards
      • Setting up your local development environment
      • Diving into PrestaShop Core development
      • Creating a PrestaShop module
      • Creating a front-office module
      • Creating a module with both front-end and back-end controllers
      • Hooks in PrestaShop 1.5
      • Translations in PrestaShop 1.5
      • How to use the Forge to contribute to PrestaShop
      • How to write a commit message
      • Contributing code to PrestaShop
    • Designer Guide
      • Theme development fundamentals
      • Integrating content in a page using hooks
      • Characteristics of a front-office theme
      • Characteristics of a back-office theme
      • Creating your own theme
      • Theme templates and Smarty
      • Using jQuery and Ajax
      • Best practices
      • Designer tutorials
        • Changes in version 1.5 which impact theme development
        • Changing a 1.4 theme to support gift products
        • Implementing layered navigation in a theme
    • System Administrator Guide
    • Merchant's Guide
      • Our advices
      • Sample price rules
    • FAQ
      • Using PrestaShop with WordPress
    • Troubleshooting
  • Documentation française 1.5
    • À propos de PrestaShop 1.5
    • Nouveautés de PrestaShop 1.5
    • Guide de démarrage
      • Ce dont vous avez besoin
      • Installer PrestaShop
      • Installer PrestaShop en ligne de commande
      • Mettre PrestaShop à jour
      • Informations diverses
    • Guide de mise à jour
      • Mise à jour automatique
      • Mise à jour manuelle
      • Faire une sauvegarde et la restaurer
      • En cas de problème
    • Guide de l'utilisateur
      • Formations
      • Personnaliser votre boutique
      • Parcourir le front-office
      • Se connecter au back-office de Prestashop
      • Premiers pas avec PrestaShop 1.5
      • Ajouter des produits et des catégories de produits
      • Un aperçu du catalogue
      • Gérer les commandes
      • Gérer les clients
      • Mettre en place des promotions
      • Gérer les transporteurs
      • Comprendre les réglages locaux
      • Gérer les modules et les thèmes
      • Configurer les modules natifs
      • Comprendre les préférences
      • Comprendre les paramètres avancés
      • Administrer le back-office
      • Comprendre les statistiques
      • Gestion avancée des stocks
      • Gérer plusieurs boutiques
    • Guide du développeur
      • Fondamentaux
      • Norme de développement
      • Mettre en place votre environnement de développement
      • Plonger dans le développement PrestaShop
      • Créer un module PrestaShop
      • Les hooks de PrestaShop 1.5
      • Les traductions dans PrestaShop 1.5
      • Comment utiliser la Forge pour contribuer à PrestaShop
      • Comment écrire un descriptif de modification
    • Guide de l'intégrateur
      • Fondamentaux de la création de thème
      • Intégrer du contenu dans une page à l'aide de hooks
      • Caractéristiques d'un thème front-office
      • Caractéristiques d'un thème back-office
      • Template de thème et Smarty
      • Utiliser jQuery et Ajax
      • Bonnes pratiques
    • Guide de l'administrateur système
    • Guide du vendeur
      • Exemples de promotions
      • Nos bons conseils
    • Questions fréquentes
    • Dépannage
  • Documentación española 1.5
    • Acerca de PrestaShop 1.5
    • Introducción
      • Lo que necesita para empezar
    • Guía del usuario
      • Formación
      • Personalización de su tienda
      • Exploración del front-office
      • Conexión al back-office de PrestaShop
      • Primeros pasos con PrestaShop 1.5
      • Añadir productos y categorías de productos
      • Una mirada interna al catálogo
      • Gestionar pedidos
      • Gestionar clientes
      • Crear reglas de precios y cupones
      • Gestionar el transporte
      • Comprender la Configuración Local
      • Gestionar módulos y temas
      • Configurar los Módulos Nativos
      • Comprender las Preferencias
      • Comprender los Parámetros avanzados
      • Administrar el Back-Office
      • Comprender las estadísticas
      • Gestión avanzada de stock
      • Gestionar varias tiendas
    • Guía del Desarrollador
      • Tutoriales para Desarrolladores
        • Uso del Web Service de Prestashop
          • Capítulo 1 - Creación de acceso al Back Office
  • Документация на русском языке 1.5
    • Информация о PrestaShop 1.5
    • Новые функции в PrestaShop 1.5
    • Приступая к работе
      • Что нужно чтобы приступить к работе
      • Установка PrestaShop
      • Установка PrestaShop при помощи командной строки
      • Обновление и удаление PrestaShop
      • Прочая информация
    • Руководство пользователя
      • Обучение
      • Настройка вашего магазина
      • Изучение публичной части сайта
      • Бэк-офис PrestaShop
      • Первые шаги в PrestaShop 1.5
      • Добавление товаров и товарных категорий
      • Внутри каталога
      • Управление заказами
      • Работа с клиентами
      • Создание правил ценообразования корзины и ваучеров
      • Управление доставкой
      • Ориентация в локальных настройках
      • Управление модулями и темами
      • Настойка встроенных модулей
      • Ориентация в настройках
      • Ориентация в расширенных параметрах
      • Администрирование Back-Office
      • Ориентация в статистике
      • Расширенное управление запасами
      • Управление мультимагазином
Powered by GitBook
On this page
  • Intégrer du contenu dans une page à l'aide de hooks
  • Hooks existants : front-office
  • Hooks existants : back-office
  • Visualiser l'emplacement des principaux hooks

Was this helpful?

  1. Documentation française 1.5
  2. Guide de l'intégrateur

Intégrer du contenu dans une page à l'aide de hooks

PreviousFondamentaux de la création de thèmeNextCaractéristiques d'un thème front-office

Last updated 4 years ago

Was this helpful?

Contenu

Intégrer du contenu dans une page à l'aide de hooks

Les points d'accroche, ou "hooks", permettent d'associer votre code à des évènements propres à PrestaShop.

La plupart du temps, ils sont utilisés pour insérer du contenu dans la page.

Par exemple, le thème par défaut de PrestaShop dispose des hooks suivants :

Hook name

Description

displayHeader

Displays the content in the page's header area.

displayTop

Displays the content in the page's top area.

displayLeftColumn

Displays the content in the page's left column.

displayHome

Displays the content in the page's central area.

displayRightColumn

Displays the content in the page's right column.

displayFooter

Displays the content in the page's footer area.

Les hooks peuvent également être utilisés pour lancer des actions précises en fonction des circonstances (par exemple, envoyer un e-mail au client).

Hooks existants : front-office

Page d'accueil et pages générales du site

Hook name

Description

displayHeader

Called within the HTML <head> tag. Ideal location for adding JavaScript and CSS files.

displayTop

Called in the page's header.

displayLeftColumn

Called when loading the left column.

displayRightColumn

Called when loading the right column.

displayFooter

Called in the page's footer.

displayHome

Called at the center of the homepage.

Page produit

Hook name

Description

displayLeftColumnProduct

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

displayRightColumnProduct

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

displayProductButtons

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

actionProductOutOfStock

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

displayFooterProduct

Called right before the tabs.

displayProductTab

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

displayProductTabContent

Called when a tab is clicked.

Page du panier

Hook name

Description

actionCartSave

Called right after a cart creation or update.

displayShoppingCartFooter

Called right below the cart items table.

displayShoppingCart

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

displayCustomerAccountFormTop

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

displayCustomerAccountForm

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

actionCustomerAccountAdd

Called right after the client account creation.

displayCustomerAccount

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

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.

displayMyAccountBlockfooter

Displays extra information inside the "My account" block.

actionAuthentication

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

actionBeforeAuthentication

Called right before authentication.

Page de recherche

Hook name

Description

actionSearch

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

Page de choix du transport

Hook name

Description

displayBeforeCarrier

Displayed before the carrier list on front-office.

displayCarrierList

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

Page de paiement

Hook name

Description

displayPaymentTop

Top of payment page.

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.

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.

displayOrderConfirmation

A duplicate of paymentReturn.

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

Page de commande

Hook name

Description

actionOrderReturn

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

displayPDFInvoice

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

Hooks existants : back-office

Hooks généraux

Hook name

Description

displayBackOfficeTop

Called within the header, above the tabs.

displayBackOfficeHeader

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

displayBackOfficeFooter

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

displayBackOfficeHome

Called at the center of the homepage.

Commandes et détails de la commande

Hook name

Description

actionValidateOrder

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

actionPaymentConfirmation

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

actionOrderStatusUpdate

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

actionOrderStatusPostUpdate

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

actionProductCancel

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

displayInvoice

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

displayAdminOrder

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

actionOrderSlipAdd

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

Produits

Hook name

Description

actionProductSave

Called when saving products.

actionUpdateQuantity

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

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

actionProductAttributeDelete

Called when a product declination is deleted.

actionWatermark

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

displayAttributeForm

Add fields to the form "attribute value".

displayAttributeGroupForm

Add fields to the form "attribute group".

displayAttributeGroupPostProcess

Called when post-process in admin attribute group.

displayFeatureForm

Add fields to the form "feature".

displayFeaturePostProcess

Called when post-process in admin feature.

displayFeatureValueForm

Add fields to the form "feature value".

displayFeatureValuePostProcess

Called when post-process in admin feature value.

Statistiques

Hook name

Description

displayAdminStatsGraphEngine

Called when a stats graph is displayed.

displayAdminStatsGridEngine

Called when the grid of stats is displayed.

displayAdminStatsModules

Called when the list of stats modules is displayed.

Clients

Hook name

Description

displayAdminCustomers

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

Transporteurs

Hook name

Description

actionCarrierUpdate

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

Visualiser l'emplacement des principaux hooks

L'un des principaux aspects de l'intégration du contenu de PrestaShop dans votre thème, consiste à savoir où votre contenu sera affiché, et donc à savoir où exactement se trouvent les hooks et modules.

Cette section vous donne une représentation visuelle de leur position sur la page d'accueil. Elle vous indique

  • le nom du bloc ;

  • l'identifiant du bloc, afin de le cibler en CSS ;

  • le dossier du bloc ou son fichier template, si vous souhaitez le modifier.

Zones principales de contenu

En-tête de la page

Colonne de gauche

Zone centrale

Colonne de droite

Catégories

Intégrer du contenu dans une page à l'aide de hooks
Hooks existants : front-office
Page d'accueil et pages générales du site
Page produit
Page du panier
Page de recherche
Page de choix du transport
Page de paiement
Page de commande
Hooks existants : back-office
Hooks généraux
Commandes et détails de la commande
Produits
Statistiques
Clients
Transporteurs
Visualiser l'emplacement des principaux hooks
Zones principales de contenu
En-tête de la page
Colonne de gauche
Zone centrale
Colonne de droite
Catégories