Jump to content

Edit History

Chill_user

Chill_user

How to register hook

First, create a hook function in your main .php file of your module. Like this:

public function hookyour_hook_nameHook() {
	dump("it works");
}

Next step, registration of the hook:

1. Programmatically:

During the installation ( function install() ) you have next line:

return parent::install() &&
            $this->registerHook('your_custom_hook_name');

actually, you can register hook anywhere you want with next line:

$this->registerHook('your_custom_hook_name');

2. In the BO of prestashop (I prefer this one):

Go to Design->Positions->Transplant a module (top-right corner)->"choose_your_module"->"choose hook you created" ->Save

 

P.S. the hook "triggers" by itself, you don't need to call it somewhere

P.S2. You can fast create a module here, than follow the instructions I described to you above.

 

Chill_user

Chill_user

How to register hook

First, create a hook function in your main .php file of your module. Like this:

public function hookyour_hook_nameHook() {
	dump("it works");
}

Next step, registration of the hook:

1. Programmatically:

During the installation ( function install() ) you have next line:

return parent::install() &&
            $this->registerHook('your_custom_hook_name');

actually, you can register hook anywhere you want with next line:

$this->registerHook('your_custom_hook_name');

2. In the BO of prestashop (I prefer this one):

Go to Design->Positions->Transplant a module (top-right corner)->"choose_your_module"->"choose hook you created" ->Save

 

 

Chill_user

Chill_user

How to register hook

First, create a hook function in your main .php file of your module. Like this:

public function hookyour_hook_nameHook() {
	dump("it works");
}

Next step, registration of the hook:

1. Programmatically:

During the installation ( function install() ) you have next line:

return parent::install() &&
            $this->registerHook('your_custom_hook_name');

actually, you can register hook anywhere you want with next line:

$this->registerHook('your_custom_hook_name');

2. In the BO of prestashop (I prefer this one):

Go to Design->Positions->Transplant a module (top-right corner)->"choose_your_module"->"choose hook you created" ->Save

 

 

×
×
  • Create New...