In one of your template, just add the hook you want
For example, index
{hook h='displayMyNewHook'}
Then, you can create one (or more) module with this method :
/modules/mymodule/
/modules/mymodule/mymodule.php
Content of mymodule.php
class MyModule extends Module
{
function __construct()
{
$this->name = 'mymodule';
$this->tab = 'advertising_marketing';
$this->author = 'Your name';
$this->version = '1.0';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('My Module');
$this->description = $this->l('Example of module');
}
public function install()
{
// Here the registerHook method will check if the hook exists, if not it will add it to table ps_hook
return (parent::install() AND $this->registerHook('displayMyNewHook');
}
public function hookDisplayMyNewHook($params)
{
return 'myDisplay';
}
}
Now, you have "myDisplay" displayed where you put your hook.
If you want to see this hook in your adminpanel to have the possibility to change order of module which are hooked on.
You will have (unfortunately) to go to you phpmyadmin and set the flag "position" to 1 in the table ps_hook for this hook.
Tell me if something is not clear
Contact (9am-6pm EST) +1-888-947-6543


Back to top









