Jump to content

[SOLVED]Blocknewsletter error messages not working correctly when mod is not hooked into left column


defuzed

Recommended Posts

Hi,

 

I created a hook to hook modules into cms pages and hooked the newsletter module into it.

 

Everything works perfectly fine, except i always get the message "e-mail is already registered" even though the module is working just fine. This only happens in the cms hook.

 

I am pretty new to prestashop so maybe some more experienced users might know what could be causing this?

 

this is the code i'm using to create the hook, in override/controllers/front/CmsController.php

<?php
class CmsController extends CmsControllerCore
{
public function process()
{
parent::process();
$this->context->smarty->assign(array(
 'HOOK_CMS' => Hook::exec('displayCms'),
));
}
}

 

and this is how i register it in the blocknewsletter module

public function hookDisplayCms($params)
{
 $this->_prepareHook($params);
 return $this->display(__FILE__, 'blocknewsletter.tpl');
}

 

really don't understand what's going on since the module is doing the right thing, just displaying the wrong status message :(

 

any help would be greatl yappreciated

Link to comment
Share on other sites

Ok the problem was the way i created the hook. Instead of putting it in the CmsController override, i placed it in FrontController class override along with the other hooks, now it works. Please mark as solved or delete the topic.

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

  • 2 years later...

Ok the problem was the way i created the hook. Instead of putting it in the CmsController override, i placed it in FrontController class override along with the other hooks, now it works. Please mark as solved or delete the topic.

 

i've the same problem but i can't solved it.

On LeftColumn it works properly, but in the cms page i've got the same error message.

Can you please post your full solution?

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