johnme Posted April 7, 2011 Share Posted April 7, 2011 Hi Friends Any one can tell me How to hook newletter block In footer page i am using 1.3.7 Link to comment Share on other sites More sharing options...
johnme Posted April 8, 2011 Author Share Posted April 8, 2011 any one can help me please . still i am looking for help Link to comment Share on other sites More sharing options...
prestanesia Posted April 8, 2011 Share Posted April 8, 2011 In blocknewsletter.php in the install function make the modules to hook to the footer public function install() { if (parent::install() == false OR $this->registerHook('leftColumn') == false OR $this->registerHook('footer') == false) Create a new code for hooking to the footer, you can copy from hookLeftColumn (note the name of the function, hookFooter and the tempate being loaded - blocknewsletterfooter.tpl) : function hookFooter($params) { global $smarty; if (Tools::isSubmit('submitNewsletter')) { $this->newsletterRegistration(); if ($this->error) { $smarty->assign(array('color' => 'red', 'msg' => $this->error, 'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false, 'nw_error' => true, 'action' => $_POST['action'])); } elseif ($this->valid) { if (Configuration::get('NW_CONFIRMATION_EMAIL') AND isset($_POST['action']) AND intval($_POST['action']) == 0) Mail::Send(intval($params['cookie']->id_lang), 'newsletter_conf', $this->l('Newsletter confirmation'), array(), pSQL($_POST['email']), NULL, NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/'); $smarty->assign(array('color' => 'green', 'msg' => $this->valid, 'nw_error' => false)); } } $smarty->assign('this_path', $this->_path); return $this->display(__FILE__, 'blocknewsletterfooter.tpl'); } copy blocknewsletter.tpl to blocknewsletterfooter.tpl & modify it to your needs. Link to comment Share on other sites More sharing options...
johnme Posted April 8, 2011 Author Share Posted April 8, 2011 Thanks Friend . Thats is installed Sucessfully ... Now its okey .. thanks a lot Thanks For help Link to comment Share on other sites More sharing options...
prestanesia Posted April 8, 2011 Share Posted April 8, 2011 Check this code function hookRightColumn($params) { return $this->hookLeftColumn($params); } the function hookLeftColumn is not exist in the class. Just copy from hookFooter, rename the function to hookLeftColumn and dont forget to set the proper tpl file (blocknewsletter.tpl). Link to comment Share on other sites More sharing options...
johnme Posted April 8, 2011 Author Share Posted April 8, 2011 now i think its work now .. I put this Code >> } << on Line 209 After its okey Link to comment Share on other sites More sharing options...
Recommended Posts