defuzed Posted May 31, 2013 Share Posted May 31, 2013 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 More sharing options...
defuzed Posted June 3, 2013 Author Share Posted June 3, 2013 (edited) 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 June 3, 2013 by defuzed (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted June 3, 2013 Share Posted June 3, 2013 Thanks for sharing the solution! mark as solved, pascal Link to comment Share on other sites More sharing options...
m3w Posted February 15, 2016 Share Posted February 15, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now