| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Always Show Sub Categories Below Root Category | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
#2
|
|||||||||
|
|||||||||
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 |
|||||||||
#3
|
|||||||
|
|||||||
Re: Always Show Sub Categories Below Root Category
Quote:
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 |
|||||||
#4
|
|||||||||
|
|||||||||
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 |
|||||||||
#5
|
|||||||
|
|||||||
Re: Always Show Sub Categories Below Root Category
Quote:
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 |
|||||||
#6
|
|||||||||
|
|||||||||
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 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|