View Single Post
  #17  
Old 08-01-2004, 07:13 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,091
 

Default

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
Code:
{* BCSE Begin *} {section name=super_idx loop=$super_subcategory} <font class=CategoriesList>{$super_subcategory[super_idx].category_name}</font> {/section} {* BCSE End *}

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote