tridcatij Posted May 3, 2013 Share Posted May 3, 2013 Hello everybody! Maybe question is not correct, I will try to explain. When customer making an order, on the "Choose payment method" step I need to get value from the previous "Carrier" page and put it into the $cookie->var. So the question is - is it necessary to call .tpl file? Because I don't need to show any info in the hook, I only need to execute this small script. I tried to make it with .tpl also, but there was no result: public function hookpayment($params) { global $cookie; $cookie->indoorChecked = (int)Tools::getValue('id_indoor'); $cookie->write(); $smarty->assign('indoorChecked', $cookie->indoorChecked); return $this->display(__FILE__, _PS_THEME_DIR_.'payment.tpl'); } Hoping for your assistance. Link to comment Share on other sites More sharing options...
Paul C Posted May 3, 2013 Share Posted May 3, 2013 No, your hook function doesn't need to display anything. As long as you make an appropriate call to $this->registerHook() in the install function. What version of Prestashop are you using though? (Your code isn't correct for 1.5.4 plus you're accessing the variable $smarty when it hasn't been declared/initialised). Link to comment Share on other sites More sharing options...
tridcatij Posted May 3, 2013 Author Share Posted May 3, 2013 Paul C, Thanks for your reply! I'm using 1.4.9.0 version. ($smarty declared also, I forgot to write it in this example.)..so the correct code should look like this: public function hookpayment($params) { global $cookie; $cookie->indoorChecked = (int)Tools::getValue('id_indoor'); $cookie->write(); } ? Link to comment Share on other sites More sharing options...
ileriya Posted August 30, 2013 Share Posted August 30, 2013 Hello! tridcatij, I have the same problem. Do you have any solutions? You are my last hope. Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2013 Share Posted August 30, 2013 Hello! tridcatij, I have the same problem. Do you have any solutions? You are my last hope. it's not necessary to display something in hooks, you can run code without tpl files. 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