ikanimo Posted July 29, 2011 Share Posted July 29, 2011 I want to put in my header.tpl the date time: so I try to put in FrontController.php public function displayHeader() $date_time = (date("l, w F Y")); self::$smarty->assign('date_time_tpl',$date_time ); then visual the date by put variable on header.tpl {$date_time_tpl} now works!!! thanks to everybody, expecial rocky!!! Link to comment Share on other sites More sharing options...
shokinro Posted July 29, 2011 Share Posted July 29, 2011 you code are correct. I guess it is cache. try to clear your PrestaShop cache Preferences tab - Performances tab Smarty force compile : yes, cache : disabled Cache (at page bottom): disabled Link to comment Share on other sites More sharing options...
rocky Posted July 29, 2011 Share Posted July 29, 2011 You're assigning the variable to index.tpl, not header.tpl. You should override the displayHeader() functin of classes/FrontController.php instead. Link to comment Share on other sites More sharing options...
mmsh Posted November 16, 2012 Share Posted November 16, 2012 (edited) hi, how to access a database field , example $product->supplier_reference for the current product page, into the header.tpl ? thanks Edited November 16, 2012 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
tebdilikiyafet Posted February 27, 2013 Share Posted February 27, 2013 (edited) It didn't work for me. does it work for vs 1.5.1.3 ? I've done everything above but when I debug the page I can not see the new variable. I also copy and paste the example 3 from prestashop user guide it didn't work too. force compile is active and cache is close. what is wrong here? Edited February 27, 2013 by tebdilikiyafet (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts