Warning: You are browsing the documentation for PrestaShop 8, which is outdated.

You might want to read an updated version of this page for the current version, PrestaShop 9. Read the updated version of this page

Learn how to update to the latest version.

Hook displayOverrideTemplate

Informations

Change the default template of current controller
Hook displayOverrideTemplate
Locations
FO
Type display
Origin core
Aliases
Description

Located in

Origin File
core classes/controller/FrontController.php

Call of the Hook in the origin file

Before 8.1

Hook::exec(
  'displayOverrideTemplate',
  [
    'controller' => $this,
    'template_file' => $template,
    'id' => $params['id'],
    'locale' => $locale,
  ]
)

From 8.1

Hook::exec(
  'displayOverrideTemplate',
  [
    'controller' => $this,
    'template_file' => $template,
    'entity' => $params['entity'],
    'id' => $params['id'],
    'locale' => $locale,
  ]
)