$Smarty assign won't parse
Hi folks -
I have a simple sql query I want to run conditionally in my product.tpl [depending on which product is selected]. It accesses an added mysql table containing additional product info. I have written a small script, workshops.php, which I put in store/customer/, like this: Code:
<? The file mentioned in the last line, 'workshops.tpl', is in [skin1]/customer/main, and looks like this: Code:
Finally, I have an {if} statement in [skin1]/customer/main/product.tpl: Code:
The problem is, no matter how I try to configure it, products.tpl chokes at the line beginning '$smarty->assign...' when parsing workshops.php. It renders everything after the first '$smarty->' [ie from the word 'assign...' onward] in the browser as text, and the include of workshops.tpl doesn't happen. Any idea where I've gone wrong? All suggestions greatly appreciated! Cheers Les |
Hello friend,
I believe that you cannot include .php files in a smarty include statement. You will have to get around that it by requiring the file in product.php using Code:
require "./workshops.php" Alter your if/else statement to fit .php style, or private message me with your if else statement and what you would like to do with it if you would like. (gramma alert! T_T) |
All times are GMT -8. The time now is 01:20 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.