473,385 Members | 1,275 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

multiple shopping cart selection

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!
Oct 23 '05 #1
1 1951
<?php
$msg='Text boxes not set';
if(isset($_GET['txt']))
{
$msg=implode('--',$_GET['txt']);
}
?>
<html><head><title>Example of how to process multiple data input
lines</title></head><body>

<form>
<input name="txt[]" type="text" />
<br />
<input name="txt[]" type="text" />
<br />
<input name="txt[]" type="text" />
<br />
<input type="submit" />
<br />
</form>
<?php echo $msg; ?>
<br />

Regards
<br />
Ian
</body></html>

Oct 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tony | last post by:
Hello everyone.. I am in the processof seting up a shopping cart . this cart is not designed by me . is pure ASP shopping cart with access db or i can use SQL .. qustion as follow. this site...
1
by: madison | last post by:
Hi, I am trying to start a website using paypals shopping cart function. If i have 10 items and they sell out, how do I make it so the item is then listed as sold out. The next person would not...
3
by: Don Grover | last post by:
USing ASP, MSSql on W2k3 I am worried of accumulated old cart product selections from expired browser windows or other unforseen events. I am holding selected productID's & quantities & userID...
2
by: G.E.M.P | last post by:
High Level Session Handling Design for a Shopping cart 0) What am I missing? 1) How does OSCommerce do it? I'm thinking about building a shopping cart from scratch, using a library of dynamic...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the checkout.php script is given below <?...
1
by: dhyder | last post by:
OK, like the title says my error is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. I have looked into this a lot, but have not...
1
by: Infused | last post by:
Here is the problem I need a solution to. I do not have much experience in dealing with shopping carts I've setup a few but nothing this elaborate. I have a client that is dealing with multiple...
11
by: ashraf02 | last post by:
basicaly i am creating a shopping cart for my website however creating a shopping cart for one table of items is easy but can someone direct me on how to create a shopping cart that can handle more...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.