Jump to content

Allow PHP scripts in template


Recommended Posts

Hi all,

I need to allow php (+mysql querry) in .tpl file, or find any other way how include my script which sorts my manufacturers by categories.

 

I tried a lot of solutions, but without luck. Every time It returns error, blank page, or commented script:

 

<!--?php

-->

 

For example:

{php} [code] {/php}

allow_php_tag (in smarty)

...

 

 

PrestaShop™ 1.5.2.0

 

Thank you in advance for your answer

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...

open config/smarty.config.inc.php and replace

 

require_once(_PS_SMARTY_DIR_.'Smarty.class.php');

with

require_once(_PS_SMARTY_DIR_.'SmartyBC.class.php');

 

 

and

 

$smarty = new Smarty();

with

$smarty = new SmartyBC();

 

now you can use PHP code like this

 

{php}

 {/php}
  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...