Jump to content

nothing appeared after created a new hook


widjayy

Recommended Posts

Dear all,

 

I'm on prestashop 1.5. I experience a problem on creating a hook, and displaying an existing module, homefeatured.

I want to place it between the home content (two columns: left colum, center colum) and the footer.

 

I called my hook: superFooter.

 

Here what I done.

 

1. I created the hook 'superFooter' in the pss_hook table

2. I put the following code in the file /override/classes/FrontController.php for overriding:

 

<?php
class FrontController extends FrontControllerCore {
public function displayFooter()
{
self::$smarty->assign(array(
'HOOK_SUPERFOOTER' => Module::hookExec('superfooter')
));
return parent::displayFooter();
}
}

 

3. I put the following code at the beginning of my footer.tpl page:

 

{if !$content_only}
	</div>
</div>
<div id="superfooter">
{$HOOK_SUPERFOOTER}.
</div>
<!-- Footer -->

 

I tried too to replace

 {$HOOK_SUPERFOOTER} 

by

{hook h='superFooter'}

 

4. I modified the following functions in the homefeatured.php module file:

 

function install()
{
 if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) || !parent::install() || !$this->registerHook('displayHome') || !$this->registerHook('header') || !$this->registerHook('superfooter'))
  return false;
 return true;
}

 

public function hooksuperfooter($params)
{
	 return $this->hookFooter($params);
}

 

5. I transplanted the module to the new superFooter hook in my backoffice portal.

 

And... nothing appeared in my webpage.

 

Am I doing all things alright? Could you help me please?

 

Thanks a lot

Link to comment
Share on other sites

  • 4 weeks 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...