You are here: multiple shopping cart selection « PHP Programming Language « IT news, forums, messages
multiple shopping cart selection

Posted by Paul Goodley on 10/23/05 03:51

Typically, shopping carts add a single item at a time, so it's easy to
prompt the user for information needed for the order, but what if the
shopping cart needs to process thirty items at once? I am working on a
shopping cart for a wholesale project and have run into trouble.
Retailers log into the site, click a link to take them to the category,
and get table with images and a checkbox. They click the checkbox of
each item they want to order. When you're ordering a bunch of items at
once, this is much easier. The user selects a lot of small parts from a
list, then I take them to a page where I show what they selected. On
each item, I need to get input from the users, like whether the part is
bronze or stainless, metric or standard, quantity, and so forth. I build
a table for each item and then put the form elements in so it looks
something something like this:

<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td>$itemnumber</td>
<td><img name="itemimage" src="images/$itemnumber.jpg" width="32
height="32" alt=""></td>
<td><select name="composition" id="composition">
<option>brass</option>
<option>stainless</option>
<option>bronze</option>
</select></td>
<td><select name="class" id="class">
<option>SAE</option>
<option>metric</option>
</select></td>
<td><input name="quantity" type="text" id="quantity"></td>
</tr>
</table>

(There could be as many as forty of these in a single form)

I just can't seem to come up with a strategy for getting each item
and all its options stored into a mysql-backed shopping cart after I
post the form that has all their selections and options. When processing
a single item at a time, it's no problem. When I have thirty items to
loop through, it's over my head. I have never seen this done before, but
I imagine it has been done lots of times.

Is there anyone that can give me some pointers? Since I'm dealing
with twenty or thirty different items at a time, each with their own
sets of options, how can I treat each of the items as a single "line"--
in other words, enter one item into the DB, along with its two or three
parameters, like grade, size and metric or SAE? Is there a way to make
the form so each one of the items gets treated separately, or can I
somehow make each table get treated as a separate form when it gets posted?



Thanks tons for the assistance!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация