Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Always Show Sub Categories Below Root Category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #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
  #2  
Old 04-18-2012, 09:13 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Always Show Sub Categories Below Root Category

Most likely $subcategories doesn't exist. You probably need to do some php changes
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 04-18-2012, 10:55 AM
 
shiehshieh shiehshieh is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 85
 

Default Re: Always Show Sub Categories Below Root Category

Quote:
Originally Posted by cflsystems
Most likely $subcategories doesn't exist. You probably need to do some php changes

would you happen to have any sample code on populating the $subcategories variable?
__________________
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
  #4  
Old 04-18-2012, 03:16 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Always Show Sub Categories Below Root Category

This is a start - http://forum.x-cart.com/showthread.php?t=45126&highlight=allcategories
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 04-19-2012, 04:42 AM
 
shiehshieh shiehshieh is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 85
 

Default Re: Always Show Sub Categories Below Root Category

Quote:
Originally Posted by cflsystems

I'm trying that code however it appears to not be working, maybe due to the fact i'm running 4.1 and they are running 4.2 - too bad cuz it looks like its exactly what i need
__________________
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
  #6  
Old 04-19-2012, 07:51 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Always Show Sub Categories Below Root Category

You can't just copy/paste. You have to modify it to fit your cart version
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:03 PM.

   

 
X-Cart forums © 2001-2020