View Single Post
  #1  
Old 04-18-2012, 08:08 AM
 
shiehshieh shiehshieh is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 85
 

Default Always Show Sub Categories Below Root Category

Hi,

I'm tryign to make it so that all subcategories (first level) always show under their root category - I was using the following code to try to accomplish it but have no luck:

{foreach from=$categories item=c}
<div id="category-header"><a href="home.php?cat={$c.categoryid}">{$c.category}< /a></div>
<div id="category-wrapper">
{foreach from=$subcategories item=c key=$c.categoryid}
<div id="category-item" {if $c.categoryid eq $cat} class="selected" {/if}><a href="home.php?cat={$catid}">{$c.categoryid} {$c.category|replace:'Low Acid ':''}</a></div>
{/foreach}
</div>
{/foreach}
__________________
Cheers,
Tom
X-Cart v4.1.9 PRO

Boba Tea Direct
"Your source for bubble tea, boba, coffee, tea, chai, and more"
www.bobateadirect.com

Hevla Coffee Co
Freshest roast-to-order low acid coffee
www.hevlacoffeeco.com
Reply With Quote