Jump to content

Hook et fonction install


Recommended Posts

Bonjour à tous et toutes,

 

Je débute dans prestashop et essaye de mettre un hook en place dans la version 1.5

 

J'ai donc dans mon header.tpl

{hook h="MonHook"}

 

Dans le module categories.php

 

function hookMonHook($params)

{

return $this->hookLeftColumn($params);

}

 

et je dois mettre aussi le code pour la création automatique dans la BDD de mon hook

($this->registerHook('MonHook'))

 

Mais où exactement dans le code ci-dessous ?????

public function install()
{
 if (!parent::install() ||
  !$this->registerHook('leftColumn') ||
  !$this->registerHook('footer') ||
  !$this->registerHook('header') ||
  // Temporary hooks. Do NOT hook any module on it. Some CRUD hook will replace them as soon as possible.
  !$this->registerHook('categoryAddition') ||
  !$this->registerHook('categoryUpdate') ||
  !$this->registerHook('categoryDeletion') ||
  !$this->registerHook('actionAdminMetaControllerUpdate_optionsBefore') ||
  !$this->registerHook('actionAdminLanguagesControllerStatusBefore') ||
  !Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', 4) ||
  !Configuration::updateValue('BLOCK_CATEG_DHTML', 1))
  return false;
 return true;
}

 

Après faut il greffer la position du module ?

 

Merci de votre aide.

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...