View Single Post
  #1  
Old 07-23-2009, 03:09 PM
 
Sunbreaks Sunbreaks is offline
 

Newbie
  
Join Date: Jun 2008
Posts: 5
 

Question Simple dropdown loop to show subcategories

Hi there,

I'd like to have some very simple dropdown menus, but I'm stuck. So far the dropdowns are being created correctly, but I can't get them to list the subcategories as the options. Here's my code:

Code:
{capture name=menu} <form name="side_searchform" action="saunders_search.php?cat={$catid}" method="post"> <table cellpadding="4" cellspacing="1"> {foreach from=$subcategories item=c key=catid} {if $c.category} {assign var="tmp" value="1"} {/if} <tr><td> <select name="{$c.category}"> {if $subcategories} {foreach from=$subcategories item=subcat} {if $tmp and $first_subcat ne "Y"} {assign var="first_subcat" value="Y"} {/if} <option value="{ $subcat.category|escape }">{ $subcat.category|escape } {/foreach} {/if} </select> <input type=submit value="GO"> </td></tr> {/foreach} </table> </form> {/capture} { include file="saunders_menu.tpl" menu_content=$smarty.capture.menu}

And here's what it looks like:
http://forum.x-cart.com/attachment.php?attachmentid=1598&stc=1&d=124839039 5
As you can see, the dropdown options are exactly the same as the main categories, rather than listing the subcategories.

Can someone please tell me how to get the option values to get down into my subcategories?

Thanks very much!
Sunbreaks
Attached Thumbnails
Click image for larger version

Name:	Picture 4.png
Views:	230
Size:	18.2 KB
ID:	1598  
__________________
4.1.10
Reply With Quote