View Single Post
  #1  
Old 10-05-2009, 11:23 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 Declaring a Category for Subcategories

Simply put. In the front page of the site I have a "Foreach" pulling from the Categories Array.

Each Category is coming out just fine, with descriptions and pictures and everything.

But I'm trying to get the Subcategories to show up for EACH category.

Unfortunately, whenever I try to use the syntax for Subcategories [$subcategories] it just pulls up the categories all over again. Image Included.

http://frozeninksecret.com/tmp/cat.jpg

Code:
{foreach from=$categories item=cat} <div class="bot_products"> <a class="bot_products_img" href="home.php?cat={ $cat.categoryid }"><img src="{$xcart_web_dir}/image.php?id={ $cat.categoryid }&amp;type=C" alt="" /></a> <a class="bot_products_txt" href="home.php?cat={ $cat.categoryid }"><b>{ $cat.category }</b></a> <br /><br /> <div style="OVERFLOW: hidden; HEIGHT: 72px; font-size:12px"> {foreach from=$subcategories item=subcat} <a href="home.php?cat={ $subcat.categoryid }">{ $subcat.category|escape }</a><br /> {/foreach} </div> </div> {/foreach}

This is the section of the code it involves. In skin1/customer/homelist.tpl

Is there anyway you can load the subcategories within a category for a FOREACH array?
__________________
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