View Single Post
Old 10-11-2005, 06:59 PM   #1 (permalink)
BUFFY
Registered User
 
Join Date: May 2005
Posts: 29
BUFFY is on a distinguished road
Order Multiple Items

Hi all,

Last time I was here i recieved great advice, Ive searched the forums for similar topics but the results were mainly regarding multiple sorts.

Heres my delimma:

I have a php site which displays products for ordering. When a customer orders them it has nothing to do with credit card details etc its only a order request that gets recorded - eg. productid, quantity, productsize....

My products are in several different categories. A customer selects a category and all the related products a shown... select * from product where category = "Tshirts" for example.

Then I have my while loop display all the available tshirts and their details. Then comes the order part.

This is what im trying to achieve:

Each product with have a tick box next to it for placing a order... a customer could tick 3 of the 5 items then select the perfered size from the dropdown HTML box. Then for each item they would enter in the quantity. Then click the 'order selected items' option.

I then want my code to insert each item (productid, customerid) into the order table... so in this case it would insert each different productid (all 3) individually into the order table. Each record will have a order number that is the same to link them all orderid I guess.

How do I tackle this? I have been told to have a orderitem table (with the quantity field in it) as a junction between the product and orders table so I will need certain joins i guess.

How do I just pick out the items that have had a tick box ticked?

I will proberly need to explain this further but for now I will leave it at this incase someone can direct me to a thread that has dealt with multiple order items/quantity etc.

I have code showing the query but that doesn't really relate to what im trying to do as its just a normal query.

All suggestions appreciated.... I looked at oscommerce but its far to complex for what Im trying to do.... a far smaller scale!

Thanks
BUFFY is offline   Reply With Quote