Jump to content

Problem With Transplanting Module To Hook.


Recommended Posts

Hello, I am newbie to Prestashop. 
 

I've got displayPromoteTop hook placed in header.tpl.

<div class="promoted-top">
<div class="promote-top">
<div class="container">
<div class="row">
{hook h="displayPromoteTop"}
</div>
</div>
</div>

 It has hooked module PtsStaticContent and it displays properly. I have added this code to be able to hook blocknewsletter to this hook.

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

But after all i get this error in console and page is no longer rendered properly.

 

Uncaught ReferenceError: FancyboxI18nClose is not defined global.js(92).

 

If i unhook this module everything is working again.

 

Any ideas?

Edited by Zilurex (see edit history)
Link to comment
Share on other sites

When you create public function to display a hook you need to either create some content to that hook or return the content from another hook who has all relevant content.

 

Try to return the left column, like:

 

public function hookDisplayPromoteTop($params)
    {
        return $this->hookDisplayLeftColumn($params);
    }

Link to comment
Share on other sites

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...