gjh42:
The easiest way to do this is probably by adding a switch that suppresses output of any category that is not current and a subcat.
Find this line in /includes/templates/your_template/sideboxes/tpl_categories.php```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
> $current_top = false;
> if ((int)str_replace("cPath=","",$box_categories_array[$i]['path']) == $_GET['cPath']) { //top cat of path is active
> $current_top = true;
> }
>
> above it, and
>
> ($current_top == false) or ($box_categories_array[$i]['top'] == 'true') or
> inside it to get```php
$current_top = false;
if ((int)str_replace("cPath=","",$box_categories_array[$i]['path']) == $_GET['cPath']) { //top cat of path is active
$current_top = true;
}
if (($current_top == false) or ($box_categories_array[$i]['top'] == 'true') 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 {
I haven't tested this yet, so try it and let me know how it works. If it needs tweaking, I'll take care of it.
Works great for my site too! :flex: thnx Glenn!
Only difference is that my template (zenflavr., "free templ.1") dosesnt contain "tpl_categories.php" in includes/templates/mytemplate/sideboxes/" so I had to copy "tpl_categories" that file from /templates/template_default":wink:
MY Website
The best of the best: Zen Cart