Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / weird looking sub catagories

weird looking sub catagories

Locked

Views: 885

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
7 Jul 2008, 12:26 AM
#1
goofster avatar

goofster

New Zenner

Join Date:
Jul 2008
Posts:
48
Plugin Contributions:
0

weird looking sub catagories

would anyone know why my sub catagories have |_ in front of them?

|_ RC Cars - Gas/Nitro
|_ RC Cars - Electric

my site is at goof-offs.com/goofcart

7 Jul 2008, 12:40 AM
#2
goofster avatar

goofster

New Zenner

Join Date:
Jul 2008
Posts:
48
Plugin Contributions:
0

Re: weird looking sub catagories

and is there any way to make the catagories menu collapsable so the sub catagories are hidden? or is there anyway to hid the sub catagories?

7 Jul 2008, 1:17 AM
#3
goofster avatar

goofster

New Zenner

Join Date:
Jul 2008
Posts:
48
Plugin Contributions:
0

Re: weird looking sub catagories

is there any way to make it so that as the user is clicking though the tree, products dont show up in the catagory tree but they only show up on the page itself?

7 Jul 2008, 1:21 AM
#4
goofster avatar

goofster

New Zenner

Join Date:
Jul 2008
Posts:
48
Plugin Contributions:
0

Re: weird looking sub catagories

what i want to do is make it so that the categories list behaves just like the list in the header. when you click it, the categories only appear on the page, and not underneath the category links.

7 Jul 2008, 3:56 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: weird looking sub catagories

Answering your pm for everyone's benefit...

Find this in /includes/templates/your_template/sideboxes/tpl_categories.php:

     if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
        // skip if this is for the document box (==3)
      } else { 

and add
substr_count($box_categories_array[$i]['path'],'_') > 0 or
to get

     if (substr_count($box_categories_array[$i]['path'],'_') > 0 or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
        // skip if this is for the document box (==3)
      } else { 

This will skip the category being processed if there are any underscores _ in the cPath. Subcategories always have at least one _ in the cPath.

Note: you can show any level of subcats in addition to top cats by changing the 0 to a 1, 2, etc.