| ||||||||||
| Shopping cart software Solutions for online shops and malls | ||||||||||
|
|
||||||||||
| X-Cart Home |
{php} inside template - using smarty variable | |||
![]() |
|
||
|
|
Thread Tools | Search this Thread |
|
#1
|
|||||||
|
|||||||
|
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?
__________________
CreativeArc --------------- X-Cart Pro Version: 4.1.8 |
|||||||
|
#2
|
|||||||
|
|||||||
|
{assign var=tocheck value=$orders[oid].login}
{php} $chkval = $this->get_template_vars('tocheck'); checkordernumber($chkval); {/php} |
|||||||
|
#3
|
|||||||
|
|||||||
|
YES! AWESOME! I wasn't sure if this was going to be possible. This made my day. Thank you VERY much!
__________________
CreativeArc --------------- X-Cart Pro Version: 4.1.8 |
|||||||
|
#4
|
|||||||||
|
|||||||||
|
I am trying to call a smarty variable in a template following your example:
Code:
For some reason it doesn't work... what am I doing wrong?
__________________
Version 4.7.6 X-cart Gold |
|||||||||
|
#5
|
|||||||||
|
|||||||||
|
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
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#6
|
|||||||||
|
|||||||||
|
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?
__________________
Version 4.7.6 X-cart Gold |
|||||||||
|
#7
|
|||||||||
|
|||||||||
|
Or, alternatively, can someone please upload a templater.php from non-4.6.x so I can figure it out on my own
__________________
Version 4.7.6 X-cart Gold |
|||||||||
|
|
|||
|
X-Cart forums © 2001-2020
|
|||