View Single Post
  #8  
Old 10-31-2004, 11:21 PM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default

You may want to check this mod out. It works with categories of any depth, although it will only list the first level of sub-categories for the current category.

Open customer/categories.tpl

replace:

Code:
{if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} <FONT class="CategoriesList">{$categories[cat_num].category}</FONT> {/section}

With...

Code:
{if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} <FONT class="CategoriesList">{$categories[cat_num].category}</FONT> {* Added by Fernando. Show first level of subcategories *} {if $current_category ne "" } {section name=subcat loop=$allcategories} {assign var=topmostcat value=$allcategories[subcat].categoryid_path|regex_replace:"/\/.*/":""} {assign var=current_category_top value=$current_category.categoryid_path|regex_replace:"/\/.*/":""} {if $current_category_top eq $topmostcat and $categories[cat_num].categoryid eq $topmostcat and $allcategories[subcat].parentid eq $topmostcat and $allcategories[subcat].categoryid ne $current_category_top} {$allcategories[subcat].category|truncate:20:"...":true} {/if} {/section} {/if} {* End added by Fernando *} {/section}

Cheers,
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote