Question
Shopping Cart -adding multiple items at once
I need to build a shopping cart where a list if items is
presented including a text field for quantity. But instead of each
item having it's own "add to cart" form where a user adds each item
to the cart one item at a time - the user needs to be able to go
through the list, adding quantities to each item they want, then
submit one button to add all items selected.
I can't seem to get my head around setting this up, nor can I find an example of where it has been done. Something like:
<FORM> <cfoutput>
item 1 <input type="hidden" name="#id#" value="#id#"><input type="text" name="#id#addQty">
item 2 <input type="hidden" name="#id#" value="#id#"><input type="text" name="#id#addQty"> </cfoutput>
<input type="submit" name="submit">
</form>
If I use the above, how best to deal with the submitted form data? The field names will vary, based on the list of items. Or, is there simply a better way to do this.
I can't seem to get my head around setting this up, nor can I find an example of where it has been done. Something like:
<FORM> <cfoutput>
item 1 <input type="hidden" name="#id#" value="#id#"><input type="text" name="#id#addQty">
item 2 <input type="hidden" name="#id#" value="#id#"><input type="text" name="#id#addQty"> </cfoutput>
<input type="submit" name="submit">
</form>
If I use the above, how best to deal with the submitted form data? The field names will vary, based on the list of items. Or, is there simply a better way to do this.
