![]() |
{php} inside template - using smarty variable
In the order_list.tpl file, there's a variable that I need to use to pass it to a function.
To call the variable in the template, I use: {$orders[oid].login} I also have this in the template: {php} checkordernumber(*****); {/php} I need to somehow get the {$orders[oid].login} value into that function (where the ***** is). I know that the function works, because it runs fine with hard coded test data. Any idea on how I can accomplish this? |
Re: {php} inside template - using smarty variable
{assign var=tocheck value=$orders[oid].login}
{php} $chkval = $this->get_template_vars('tocheck'); checkordernumber($chkval); {/php} |
Re: {php} inside template - using smarty variable
YES! AWESOME! I wasn't sure if this was going to be possible. This made my day. Thank you VERY much!
|
Re: {php} inside template - using smarty variable
I am trying to call a smarty variable in a template following your example:
Code:
{assign var=phpprice value=$minicart_total_cost} For some reason it doesn't work... what am I doing wrong? |
Re: {php} inside template - using smarty variable
4.6.x does not allow some tags and smarty functions or modifiers that are not registered with the system to be used. You can change this behavior by editing include/templater/templater.php
But {php} smarty tag is deprecated and should not be used at all anyway |
Re: {php} inside template - using smarty variable
Hi and thanks for the reply!
Where can I learn more about changes I need to make to include/templater/templater.php in order to register it with a system? |
Re: {php} inside template - using smarty variable
Or, alternatively, can someone please upload a templater.php from non-4.6.x so I can figure it out on my own :) ?
|
Re: {php} inside template - using smarty variable
|
All times are GMT -8. The time now is 03:22 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.