Contacte con nosotros
Idioma:
  • English
  • Français
  • Español
Moneda:
  • AUD $
  • EUR €
  • USD $
 Iniciar sesión
shopping_cart Carrito (0)

Demo 29 PRESTAWORLD
  •   Clothes
    • Men
    • Women
  •   Accesorios
    • Stationery
    • Home Accessories
  • Art
  • Custom Price
search clear
Community Forum
  1. Inicio
  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 1 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,

Infórmese de nuestras últimas noticias y ofertas especiales

Puede darse de baja en cualquier momento. Para ello, consulte nuestra información de contacto en el aviso legal.

Productos

Productos  
  • Ofertas
  • Novedades
  • Los más vendidos

Nuestra empresa

Nuestra empresa  
  • Delivery
  • Legal Notice
  • Terms and conditions of use
  • About us
  • Secure payment
  • Contacte con nosotros
  • Mapa del sitio
  • Tiendas

Su cuenta

Su cuenta  
  • Seguimiento del pedido
  • Iniciar sesión
  • Crear una cuenta
  • Mis alertas
  •  Sales Agent Panel
Información de la tienda keyboard_arrow_down keyboard_arrow_up

Información de la tienda

Demo 29 PRESTAWORLD
Estados Unidos
Envíenos un mensaje de correo electrónico:
My wishlists
add_circle_outline Create new list
((modalTitle))

((confirmMessage))

((title))
Iniciar sesión

Debe iniciar sesión para guardar productos en su lista de deseos.

((loginText))

© 2026 - Software Ecommerce desarrollado por PrestaShop™