View Single Post
  #3  
Old 10-08-2009, 05:34 AM
  cowsdonthack's Avatar 
cowsdonthack cowsdonthack is offline
 

Advanced Member
  
Join Date: May 2009
Location: Out in the field. Chewin some grass
Posts: 89
 

Default Re: Declaring a Category for Subcategories

I've narrowed down another example of what I could use. This modification that's used on our site takes seven categories and lists their subcategories as well.
I want to modify it so that it can be used to display the subcategories in the new modification.

I've narrowed the code down to this in Include/Categories.php

Code:
$botcat_items = array(); $botcat_subcats = array(); $tmp = func_query('SELECT xcart_topmenu.*, xcart_categories.category FROM xcart_topmenu LEFT JOIN xcart_categories USING(categoryid) WHERE 1 ORDER BY position ASC'); foreach($tmp as $item) { $botcat_items[$item['position']] = array('id' => $item['categoryid'], 'name' => $item['category']); $t = func_query('SELECT categoryid, category FROM xcart_categories WHERE avail = "Y" AND parentid = ' . $item['categoryid'] . ' ORDER BY order_by ASC'); $botcat_subcats[$item['categoryid']] = $t; } $smarty->assign("botcat_items", $botcat_items); $smarty->assign("botcat_subcats", $botcat_subcats);

I'm wondering. Is there a way to use func_query to get all the categories from the SQL database?

Is there any reference on how to use func_query, because I went to Smarty's website and looked at the website and didn't find a way to use the function.

-_- please help?
__________________
Moo?
Quality Door & Hardware

Version
X-Cart 4.1.108

Add-ons
X-AOM (Advanced Order Management)
Ad / Banner X-cart Mod (BCSE)
DSEFU
Dynamic Image Mod
Pre-login Shipping Calculator
Power Filter
Contact Us Form
Shipping Carrier Mod
Submit Button

Send me a message, I can talk about anything.
Reply With Quote