Contactez-nous
Langue :
  • English
  • Français
  • Español
Devise :
  • AUD $
  • EUR €
  • USD $
 Connexion
shopping_cart Panier (0)

Demo 29 PRESTAWORLD
  •   Clothes
    • Men
    • Women
  •   Accessoires
    • Stationery
    • Home Accessories
  • Art
  • Custom Price
search clear
Community Forum
  1. Accueil
  2. Community Forum
  3. How to Create a Custom Hook in PrestaShop?

How to Create a Custom Hook in PrestaShop?

Replied by Michael Anderson 30 Jan 2026 0 Likes 0 Views thumb_up thumb_down report
Back to Topic

Hello Mark,

To add a custom section in PrestaShop, creating a custom hook is usually the recommended and upgrade-safe approach.

1. Creating a custom hook
You can create a hook either from the database or programmatically.
The simplest way is to register it in your module using:

 
$this->registerHook('displayCustomAdminSection');

If the hook does not exist, PrestaShop will automatically create it.

2. Calling the hook in a controller or TPL
Once the hook is registered, you can call it inside a .tpl file using:

 
{hook h='displayCustomAdminSection'}

If you need it in a controller, assign the hook output to Smarty using:

 
$this->context->smarty->assign( 'custom_section', Hook::exec('displayCustomAdminSection') );

3. Hook vs Override
For your use case (adding a section between KPI and list), a hook is better than an override:

  • Hooks are safer during PrestaShop upgrades

  • Overrides can break when core files change

  • Hooks allow better modular and reusable code

Overrides should only be used when no hook is available for the required position.

Hope this helps. Let me know if you need a small example module or file structure.

Best regards,

Recevez nos offres spéciales

Vous pouvez vous désinscrire à tout moment. Vous trouverez pour cela nos informations de contact dans les conditions d'utilisation du site.

Produits

Produits  
  • Promotions
  • Nouveaux produits
  • Meilleures ventes

Notre société

Notre société  
  • Delivery
  • Legal Notice
  • Terms and conditions of use
  • About us
  • Secure payment
  • Contactez-nous
  • Plan du site
  • Magasins

Votre compte

Votre compte  
  • Suivi de commande
  • Connexion
  • Créez votre compte
  • Mes alertes
  •  Sales Agent Panel
Informations keyboard_arrow_down keyboard_arrow_up

Informations

Demo 29 PRESTAWORLD
États-Unis
Envoyez-nous un e-mail :
My wishlists
add_circle_outline Create new list
((modalTitle))

((confirmMessage))

((title))
Connexion

Vous devez être connecté pour ajouter des produits à votre liste d'envies.

((loginText))

© 2026 - Logiciel e-commerce par PrestaShop™