View Single Post
  #1  
Old 09-22-2010, 08:32 AM
 
Jeremy Smith Jeremy Smith is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 167
 

Question HTML select option box for root and sub caregories problem

I am having real problems understanding how to do this.

It make sense in my head but it just is not working, can someone help?

Right here's the code I have used:

Code:
<div id="printerSearchMiddle"> {* $Id: categories.tpl,v 1.26.2.4 2008/07/22 07:58:28 ferz Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {assign var="fc_cellpadding" value="0"} {else} {if $config.General.root_categories eq "Y"} <form name="catForm">Manufacturer: <select onChange="document.catForm.submit()"> {foreach from=$categories item=c} <option value="{$c.categoryid}" {if $current_category eq {$c.categoryid}selected{/if}> {$c.category} </option> {/foreach} </select> Model: <select onChange="document.catForm.submit()"> {foreach from=$subcategories item=c key=catid} <option value="home.php?cat={$catid}">{$c.category}</option> {/foreach} </select> </form> {else} {/if} {/if} {/capture} { include file="menuDropDown.tpl" menu_content=$smarty.capture.menu } </div>

What I basically want it to do, is the user selects say:

category1 (a root category)

All the sub categories for this root category display (of course the root category still being visible)

But then what I want it to do, when the sub category is selected and the customer is able to view all products within that sub category.

The root category is still selected and can view all sub categories within that root if you like.

How can I amend my above code to reflect this need?

Just looks rather confusing to the user at the moment and its really starting to annoy me, should work, probably just something I have missed out or forgotten about.

Any help is wonderfully appreciated,
Jeremy.
__________________
Version 4.1.11 on Linux (Fedora)
X-Cart Gold
Reply With Quote