![]() |
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} |
Re: Always Show Sub Categories Below Root Category
Most likely $subcategories doesn't exist. You probably need to do some php changes
|
Re: Always Show Sub Categories Below Root Category
Quote:
would you happen to have any sample code on populating the $subcategories variable? |
Re: Always Show Sub Categories Below Root Category
This is a start - http://forum.x-cart.com/showthread.php?t=45126&highlight=allcategories
|
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 |
Re: Always Show Sub Categories Below Root Category
You can't just copy/paste. You have to modify it to fit your cart version
|
All times are GMT -8. The time now is 05:16 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.