elenichee Posted October 31, 2012 Share Posted October 31, 2012 Hi, I'm very new to Prestashop 1.5... I'm trying to figure out if it's at all possible to display the newsletter signup form on a CMS page, instead of hooking it to the footer or left column block. I would just like to display a link on the Homepage, and when the user clicks on it, he/she will be redirected to a CMS page where he/she can sign up for the newsletter. Is this possible? I've tried searching the forums but the instructions doesn't seem to work for me. Any help will be greatly appreciated.. thanks. Link to comment Share on other sites More sharing options...
CartExpert.net Posted October 31, 2012 Share Posted October 31, 2012 Hi. You will need to create a new hook which is only executed on a CMS page, also you need to create the hook's function in the module and transplant the module to the new hook. The hook function of the module should be set to verify if the user is on the CMS page, which should display the module. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
elenichee Posted November 1, 2012 Author Share Posted November 1, 2012 Hi Robin, Thanks very much for your reply. As I am very new to Prestashop, I am not quite sure how to get that done. Is there some documentation or tutorial available on Prestashop on how to do this? Link to comment Share on other sites More sharing options...
CartExpert.net Posted November 1, 2012 Share Posted November 1, 2012 Hi. Here's a tutorial: http://www.cartexpert.net/blog/2-create-new-hook-in-prestashop Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
elenichee Posted November 3, 2012 Author Share Posted November 3, 2012 Hi Robin, Thanks so much for your help. I'll give this a try and let you know how it goes. Link to comment Share on other sites More sharing options...
elenichee Posted November 11, 2012 Author Share Posted November 11, 2012 Hi Robin, I tried the tutorial you recommended but nothing seems to happen on the CMS page. I must be doing something wrong... Just wondering what should I write to replace the //code to execute? public function hookMyHook($params) { //CODE TO EXECUTE } Please help... thanks. Link to comment Share on other sites More sharing options...
CartExpert.net Posted November 12, 2012 Share Posted November 12, 2012 Hi. You need to put there the code that has to be executed. This requires coding knowledge. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
afshop Posted May 8, 2014 Share Posted May 8, 2014 Hi. Here's a tutorial: http://www.cartexpert.net/blog/2-create-new-hook-in-prestashop Regards. Robin. The CartExpert Team Hi Robin, I would see your tutorial ... but the link doesn't exists Do you have a new link? Thanks Angela Link to comment Share on other sites More sharing options...
vekia Posted May 9, 2014 Share Posted May 9, 2014 Hi Robin, I would see your tutorial ... but the link doesn't exists Do you have a new link? Thanks Angela hello check this guide: http://www.prestashop.com/forums/topic/2182[spam-filter]create-custom-and-new-hook-in-ps-15/ if you want you can also create hooks with module like html box Link to comment Share on other sites More sharing options...
afshop Posted May 13, 2014 Share Posted May 13, 2014 hello check this guide: http://www.prestashop.com/forums/topic/2182[spam-filter]create-custom-and-new-hook-in-ps-15/ if you want you can also create hooks with module like html box Hi Vekia, thanks for your response. i will try to do it; I need to hook the blocknewsletter in a new page but i don't know how to do Thanks Angela Link to comment Share on other sites More sharing options...
HiPresta Posted May 13, 2014 Share Posted May 13, 2014 Hi Robin, I tried the tutorial you recommended but nothing seems to happen on the CMS page. I must be doing something wrong... Just wondering what should I write to replace the //code to execute? public function hookMyHook($params) { //CODE TO EXECUTE } Please help... thanks. Just add this code: public function hookMyHook($params) { return $this->hookDisplayLeftColumn($params); } Link to comment Share on other sites More sharing options...
tozi Posted May 26, 2014 Share Posted May 26, 2014 (edited) Hi all, it is solved? I create hook,and insert in cms.tpl this {if $cms->id == 14} {$HOOK_displayTop2} {/if} To module blocknewsletter.php this public function hookdisplayTop2($params) { return $this->hookDisplayLeftColumn($params); } And here is the result Notice: Undefined index: HOOK_displayTop2 in /data/web/virtuals/71211/virtual/www/cache/smarty/compile/ff/b1/27/ffb127dd69299a6d85c9f99a891850d2da62493f.file.cms.tpl.php on line 118 Notice: Trying to get property of non-object in /data/web/virtuals/71211/virtual/www/cache/smarty/compile/ff/b1/27/ffb127dd69299a6d85c9f99a891850d2da62493f.file.cms.tpl.php on line 118 http://obchodpetrklic.cz/content/14-prihlaseni-k-odberu-novinek Any idea? Edited May 26, 2014 by tozi (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 26, 2014 Share Posted May 26, 2014 do you created {$HOOK_displayTop2} in cms contorller? its better to use {hook::exec('displayTop2')} instead of creating variable in controller 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