| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Inserting some PHP Code.. Which file? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Inserting some PHP Code.. Which file?
I need to reference a variable, that the variable is set dynamically by some php code.. to exaggerate on the matter...
I need to set "$isie" based upon a php if statement, and then echo $isie within the smarty template. I realize to reference a php set variable in smarty, its {$isie}.. but which file should i put this PHP code in to be parsed before head.tpl? Thanks!
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
#2
|
|||||||||
|
|||||||||
Put it a file that's called on each php page like include/check_useraccount.php
You can put it in auth.php but realize that admin/customer/partner have different auth files. |
|||||||||
#3
|
|||||||||
|
|||||||||
I need to do something similar with PHP. I need the following PHP to run on my home.php page. Where should I add it for it to be included on the home.php?
Code:
__________________
Version 4.4.1 |
|||||||||
#4
|
|||||||||
|
|||||||||
Quote:
you could require this in home.php the same as categories.php is or just do the same thing using smarty code in the templates. use things like Code:
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#5
|
|||||||||
|
|||||||||
Quote:
I tried requiring it in home.php like this: Code:
and then adding the php code I need into an affiliateid.php file but it doesn't display the code. I tried calling affiliate.php as an include but that only displays the code as is without parsing the variables. Not sure if I could use the smarty tag because it needs to call the t2.php file mentioned above to pass along the variables.
__________________
Version 4.4.1 |
|||||||||
#6
|
|||||||
|
|||||||
Have you tried putting your php code into home.tpl surrounded with {php} and {/php}?
This works for me... Instinctual Colorado X-Cart Versions 3.5.x - 4.0.12 |
|||||||
#7
|
|||||||||
|
|||||||||
Nevermind.. I found the problem.
Helps when you aren't editing one file and uploading another... DOH!
__________________
Version 4.4.1 |
|||||||||
#8
|
|||||||||
|
|||||||||
It's best to avoid using {php} tags in smarty whenever possible and keep the php in the .php file and the smarty code in the smarty templates.
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|