X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Only display 2nd level down sub categories (https://forum.x-cart.com/showthread.php?t=16848)

Mr Bob 09-25-2005 12:12 AM

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}


shan 09-25-2005 03:48 AM

search custom mods forum. this has been covered a few times

Mr Bob 09-25-2005 10:39 AM

Wow, it does exist. I wonder how many duplicate posts there are because of how bad this forum search is :oops:

shan 09-25-2005 11:45 AM

help if you then post a link to join the two threads

Mr Bob 09-25-2005 11:45 AM

Sure would: http://forum.x-cart.com/viewtopic.php?t=12058&start=30


All times are GMT -8. The time now is 01:19 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.