RedCristal Posted October 23, 2012 Share Posted October 23, 2012 Hi all In version 1.5 of Prestashop, how I can insert PHP code into a template .tpl? I tested with {include file = "file.php"}, {include_php file = "file.php"} and {php} {/ php} and I get nothing. {php} {/ php} proudce an error. The includes do not work. The template is in the themes folder and the php file in the root of the web. Thank you very much! Link to comment Share on other sites More sharing options...
vekia Posted October 23, 2012 Share Posted October 23, 2012 Hi all In version 1.5 of Prestashop, how I can insert PHP code into a template .tpl? I tested with {include file = "file.php"}, {include_php file = "file.php"} and {php} {/ php} and I get nothing. {php} {/ php} proudce an error. The includes do not work. The template is in the themes folder and the php file in the root of the web. Thank you very much! it's weird because for me {php}{/php} works well in latest prestashop version Link to comment Share on other sites More sharing options...
RedCristal Posted October 23, 2012 Author Share Posted October 23, 2012 I use the version 1.5.1.0. Can be a problem of my hosting? You have configure something in Prestashop? I hope today comes the version 1.5.2.0 Thanks vekia! Link to comment Share on other sites More sharing options...
Ebin Sebastian Posted October 23, 2012 Share Posted October 23, 2012 Do you want to connect .tpl file with php files in prestashop ???... If yes, You can connect the .tpl file and .php file with the files from the folders classes and controllers-> admin. The .tpl files will include through Admincontrollers. Link to comment Share on other sites More sharing options...
RedCristal Posted October 23, 2012 Author Share Posted October 23, 2012 Solved! It was a problem with the version of Smarty, was old and that tag ({php}) was deprecated. Here is the soucion http://www.smarty.net/docs/en/bc.tpl Link to comment Share on other sites More sharing options...
Franco84 Posted March 27, 2013 Share Posted March 27, 2013 Yesss, thank! Link to comment Share on other sites More sharing options...
mingprojects Posted September 14, 2015 Share Posted September 14, 2015 (edited) Solved! It was a problem with the version of Smarty, was old and that tag ({php}) was deprecated. Here is the soucion http://www.smarty.net/docs/en/bc.tpl Thank you. It's a little bit different in 3.5 but still doable. Edited September 25, 2015 by mingprojects (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts