I'm trying to modify my shopping cart (x-cart) to query MySQL to gather all the same fields together and put the different values in a drop down menu.
Something like this:
CPU: Athlon
CPU: Athlon XP
CPU: Duron
Would be:
CPU: Athlon
Athlon XP
Duron
Here's the code, uses the smarty template engine
{section name=field loop=$extra_fields}
<input type=hidden name="extra_array[{$extra_fields[field].fieldid}][active]" value="N">
<tr>
<td><input type=text name="extra_array[{$extra_fields[field].fieldid}][field]" size=24 value="{$extra_fields[field].field|escape:"htmlall"}"></td>
<td>
#
# Drop down list
#
<select name=extra_array[{$extra_fields[field].fieldid}][value]>{html_options values=$extra_fields[field].value output=$extra_fields[field].value} selected="1"
</td>
<td><input type=checkbox name="extra_array[{$extra_fields[field].fieldid}][active]" value="Y" {if $extra_fields[field].active eq "Y"}checked{/if}></td>
<td><input type=button value="Delete" onClick="self.location='extra_fields.php?mode=delete&fieldid={$extra_fields[field].fieldid}'"></td>
</tr>
{/section}
I'm not sure how i would get all the same fields to to combine the values into a dropdown box.
Thanks in advance,
Gabe