Jump to content

After Update to 1.4 - can not add any PHP to tpl files???


Recommended Posts

Hello,

i have updated to 1.4 and have some customized PHP Code in some of my Theme Template Files - now in 1.4. in wont read this very simple PHP Code, and runs the page into even not displaying the site.

f.e. this code below was correct before, now it even does not show the products page?!?!

what is wrong with this??? what has change at smarty???

anyone can help.

>        <!-- product's features -->
</pre>
<table cellpadding="0" cellspacing="0" width="100%">      
       {php} $name = $this->get_template_vars('NAME');
       $value = $this->get_template_vars('VALUE');
       $newprice = $this->get_template_vars('NEWPRICE');
       echo "";

       {/php}

          {php} 
          if ($name == "qualitat")  echo "Qualität:
$value";
          elseif ($name == "flugeigenschaften") echo "Flugeigenschaften:
$value";
          elseif ($name == "distance") echo "Weite:
$value";
          elseif ($name == "handicap") echo "Handicap:
$value";
          elseif ($name == "spin") echo "Spinrate:
$value";
          elseif ($name == "neupreis") { 
              echo "Ersparnis zum Neupreis:
";
              $ersparnis = (($newprice * 100) /  $value)-100;
              $ersparnis = $ersparnis * -1;
              echo ceil($ersparnis)." %";
          }
          {/php}
</table>
<br><br>   {/if

Link to comment
Share on other sites

  • 1 month later...

im not tech man, so so sorry if this comment is stupid.

I swear i remember reading somewhere (i maybe completely wrong so dont count me on it.) that before you update any files like tpl's etc you must turn 'Force Compile' to YES and 'Cache' to NO (Preferences tab then performance)

Then when finished editing, turn it back.

Sorry if this does not help.

Link to comment
Share on other sites

  • 3 weeks later...

Security settings is the issue :)

find in you shop folder:

tools -> smarty -> smarty.class.php

And:

tools -> smarty -> sysplugins ->smarty_security.php


In these two files there is a setting called:

$allow_php_tags = false

This should just be changed to:

$allow_php_tags = true

And eveything should be flying :)

Link to comment
Share on other sites

×
×
  • Create New...