| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
MySQL query in smarty template | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
MySQL query in smarty template
Is it possible to run a MySQL query and assign the value to a variable directly within a smarty template file? I cannot seem to find any info on this.
__________________
2 - X-Cart Gold 4.4.2 1 - X-Cart Gold 4.4.4 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: MySQL query in smarty template
You can use {php} php code here / assign variable to smarty {/php} but I wouldn't recommend this. Do it directly in the php file instead
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
Re: MySQL query in smarty template
Thanks.
If that is the case, how would I do so for template(s) I created? What I am trying to accomplish: - when a user clicks on a main category link in the top horizontal bar, the left bar menu will display the sub categories for that category. I have been able to do this using {if $categories} in left_bar.tpl - then when the user clicks a sub-menu link from the left bar, I need to have the sub categories listed again, but with the products for that category listed below it. This is where I thought I would use the MySQL query below to retrieve the sub categories and $cat_products to list the products below the current sub category. Code:
## Left bar ## Code:
preview so far: http://64.64.19.63/~sklz/newsite/store/Baseball/
__________________
2 - X-Cart Gold 4.4.2 1 - X-Cart Gold 4.4.4 |
|||||||
#4
|
|||||||
|
|||||||
Re: MySQL query in smarty template
Quote:
PHP Code:
Code:
__________________
2 - X-Cart Gold 4.4.2 1 - X-Cart Gold 4.4.4 |
|||||||
|
|
|||
X-Cart forums © 2001-2020
|