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

Only display 2nd level down sub categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-25-2005, 12:12 AM
 
Mr Bob Mr Bob is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 199
 

Default Only display 2nd level down sub categories

My category setup:
Dogs/Dog Name 1/Dog
Dogs/Dog Name 2/Dog
Dogs/Dog Name 3/Dog
Birds/Bird Name 1/Bird
Birds/Bird Name 2/Bird
Birds/Bird Name 3/Bird
Cats/Cat Name 1/Cat
Cats/Cat Name 2/Cat
Cats/Cat Name 3/Cat

When someone clicks on the 1st category (example Cats), it will display Cat Name 1, 2, and 3. After they click on Cat 1, 2, or 3, I want the same list to still display.

And to say it another way, that might be easier to understand... I always want the 2nd level category to display. If you click Birds as the main category, I want Bird Name 1, 2, and 3 to display. When you click on Bird Name 1, 2, or 3, I still want the Bird Name 1, 2, or 3 to display.

The following code only displays the subcategory for the page you are on, thus if you are on Cats/Cat Name 3/Cat it will NOT display the products under Cats.

Anyone help me out with this?

Code:
{* $Id: left_subcategories.tpl,v 1.00.0.0 2005/11/24 04:10:00 mclap Exp $ *} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "}{/if} {assign var="tmp" value="0"} {section name=cat_num loop=$subcategories} {if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if} {/section} {if $subcategories} {if $tmp}{/if} <div id="siteBodyLeftSubCats"> <div id="siteBodyLeftSubCatsTitle"> <div id="siteBodyLeftSubCatsTitleLeft"></div> {$current_category.category} <div id="siteBodyLeftSubCatsTitleRight"></div> </div> <ul class="subNav"> {foreach from=$subcategories item=subcat}<li class="subNavLink">{ $subcat.category|escape }{/foreach} [/list] <div id="siteBodyLeftSubCatsLL"></div> <div id="siteBodyLeftSubCatsLR"></div> </div> {/if}
__________________
Product: X-Cart Gold
Current version: 4.0.14

Additional Mods: X-Affiliate
Reply With Quote
  #2  
Old 09-25-2005, 03:48 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

search custom mods forum. this has been covered a few times
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 09-25-2005, 10:39 AM
 
Mr Bob Mr Bob is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 199
 

Default

Wow, it does exist. I wonder how many duplicate posts there are because of how bad this forum search is
__________________
Product: X-Cart Gold
Current version: 4.0.14

Additional Mods: X-Affiliate
Reply With Quote
  #4  
Old 09-25-2005, 11:45 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

help if you then post a link to join the two threads
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 09-25-2005, 11:45 AM
 
Mr Bob Mr Bob is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 199
 

Default

Sure would: http://forum.x-cart.com/viewtopic.php?t=12058&start=30
__________________
Product: X-Cart Gold
Current version: 4.0.14

Additional Mods: X-Affiliate
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 06:24 AM.

   

 
X-Cart forums © 2001-2020