View Single Post
  #3  
Old 07-08-2012, 11:01 AM
 
spiderling spiderling is offline
 

Advanced Member
  
Join Date: Jan 2011
Posts: 45
 

Default 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:
SELECT categoryid FROM xcart_categories WHERE parentid = {$current_category.parentid} ORDER BY categoryid ASC
- lastly when a product is clicked on the same menu structure needs be displayed as when the sub category is clicked


## Left bar ##
Code:
{if $categories} {include file="customer/main/category_pages_nav_create.tpl"} {elseif $current_category} {include file="customer/main/subcategory_pages_nav_create.tpl" products=$cat_products} {elseif $cat_products} {include file="customer/main/product_pages_nav_create.tpl" products=$products} {/if}

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
Reply With Quote