Find the php file which initializes and displays Smarty template. It should contain some code similar to:
$smarty = new Smarty();
I would initialize $orderid and $amount variables in the php file and pass them to Smarty using assign method:
$smarty->assign('orderid', $orderid);
$smarty->assign('amount', $amount);
Then in TPL file you can access these variables:
{if $orderid == 1}
<sometag someprop="{$amount}" />
{/if}
Main Topics
Browse All Topics





by: ScannyRPosted on 2009-01-15 at 07:52:45ID: 23384575
The problem is that Smarty is trying to interpret the PHP code as Smarty code. You need to wrap the whole lot in php tags. Just put {php} before the code and {/php} afterwards.
Rich