Thursday 11 March 2004 6:27:57 pm
Nested loops are driving me mad! (Actually the whole template thing is driving me mad. Anyone have any suggestions of where I can go to get educated?) I have working code that displays events (shop items)that have been paid for and allows the user to register for them. (I realize that the option part probably doesn't have to be a loop, and I'd appreciate help eliminating that as well.) My real issue, however, is that I want to have an inner loop based on the the count associated with the event. So if someone purchased 3 registrations to an event, they would get three lines allowing them to put a different name for each registration. I had a lame attempt at a loop, but it didn't print out anything but the name input field (the correct number of times, however). Thanks in advance for any help. -Starla
<TABLE> {section name=ProductItem loop=$order.product_items show=$order.product_items sequence=array(bglight,bgdark)}
<tr>
<td >{$ProductItem:item.object_name}<input type='hidden' name="eventName[]" value = "{$ProductItem:item.object_name}"> </TD>
{section name=Options loop=$ProductItem:item.item_object.option_list}
<td>{$ProductItem:Options:item.value}<input type='hidden' name="eventoption[]" value ="{$ProductItem:Options:item.value}"></TD>
{/section}
<TD>Name: </TD><TD><input type='text' name="regName[]"></TD>
</TR>
{/section} </TABLE>
|