To add PHP code in smarty template, you need to use

{php}

echo "test";

{/php}

Start with {php} then end with {/php}

Try putting small code and see if that works.