View Single Post
  #8  
Old 06-18-2008, 11:56 AM
 
ubergeek ubergeek is offline
 

Member
  
Join Date: Apr 2006
Posts: 22
 

Default Re: Need Help ! Subcategory dropdown

Maybe try something like this?

In subcategories.tpl find the block of code starts at or near 16 and end at 33

Code:
{if $subcategories} <table cellspacing="5" width="100%"> {foreach from=$subcategories item=subcat} <tr> {if $tmp and $first_subcat ne "Y"} <td valign="top" rowspan="{count value=$subcategories print="Y"}"><img src="{if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}" alt="" /></td> {assign var="first_subcat" value="Y"} {/if} <td class="SubcatTitle"><a href="home.php?cat={ $subcat.categoryid }"><font class="ItemsList">{ $subcat.category|escape }</font></a><br /></td> <td class="SubcatInfo">{if $config.Appearance.count_products eq "Y"} {if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products} {elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower} {/if} {/if}</td> </tr> {/foreach} </table> {/if}

Replace this if statement with the following:

Code:
{if $subcategories} <FORM> <SELECT ONCHANGE="location = this.options[this.selectedIndex].value;"> <OPTION>Select Category...</OPTION> {foreach from=$subcategories item=subcat} <OPTION VALUE="home.php?cat={ $subcat.categoryid }">{ $subcat.category|escape } {if $config.Appearance.count_products eq "Y"} {if $subcat.product_count} ({ $subcat.product_count } {$lng.lbl_products}) {elseif $subcat.subcategory_count} ({ $subcat.subcategory_count } {$lng.lbl_categories|lower}) {/if}{/if}</OPTION> {/foreach} </SELECT> </FORM> {/if}

Probably could be cleaned up some but it should get you close.
__________________
Evolve Systems
Xcart: (50+ installs, ranging from 4.0.9 to 4.5.x)
php: 5.2.13 (Mostly)
MySQL: 5.0.95 (Mostly)
Reply With Quote