I think I have it! I had a few minutes tonight to take a stab at it and seem to have it. It's not completely tested though, so let me know if you find any problems with it.
Here's how to try it:
1. - BACK UP skin1/customer/categories.tpl
- BACK UP include/categories.php
2. Add this code to include/categories.php:
Code:
# BCSE Begin
if(empty($subcategories))
{
$pos=strpos($current_category["category"],"/");
while(!$pos===false)
{
$previous_pos=$pos;
$pos=strpos($current_category["category"],"/",$pos+1);
}
$parent = substr($current_category["category"],0,($previous_pos+$pos));
if (!empty($parent))
$cur_dir_len = strlen($parent);
foreach($all_categories as $all_category)
{
$category=$all_category["category"];
if(!strstr($category,"/")) {
if(empty($parent)) {
$super_subcategories[]=$all_category;
}
}
if(!empty($parent) and substr($category,0,$cur_dir_len+1) == $parent."/" and $category!=$parent)
{
if(!strstr(substr($category,$cur_dir_len+1),"/"))
{
$all_category["category"]=ereg_replace("^.*/","",$all_category["category"]);
$super_subcategories[]=$all_category;
}
}
}
if(!empty($super_subcategories))
{
$smarty->assign("super_subcategory",$super_subcategories);
}
}
# BCSE End
After:
Code:
#
# Put all root categories to $categories array
# Put all subcategories of current_category to $categories array
#
if (!empty($current_category))
$cur_dir_len = strlen($current_category["category"]);
foreach($all_categories as $all_category) {
$category=$all_category["category"];
if(!strstr($category,"/")) {
$categories[]=$all_category;
if(empty($current_category)) {
$subcategories[]=$all_category;
}
}
if(!empty($current_category) and substr($category,0,$cur_dir_len+1) == $current_category["category"]."/" and $category!=$current_category["category"])
if(!strstr(substr($category,$cur_dir_len+1),"/")) {
$all_category["category"]=ereg_replace("^.*/","",$all_category["category"]);
$subcategories[]=$all_category;
}
}
3. Add this code to skin1/customer/categories.tpl
Before:
Code:
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
I tested this on 3.5.10. It should work on 3.5.9.
Hope this helps!
Carrie