Hi guys,
I really need your help - not so much with code, just need an idea on how to do the following:
I am building an e-commerce site selling cricket bats. For each cricket bat you can have a number of options including different sizes, widths, handle size, colour etc... (The list of choices is huge).
I have created the cricket bat table in the database, which stores the product information (Bat ID, Bat name, price, image).
The options table has seperate columns for Bat Size, Bat Weight, Bat Face Material, Bat Color etc...
I have an orders table, a customers table and an order contents table. The order contents table will store the product ID's for each item in the order.
When the user adds a cricket bat to their shopping cart, I store this info in a SESSION Array, with a unique ID.
I'm not sure how to get this information into the database when the user checks out... here's why:
When the user submits their order, I thought I should enter the customer details into the customer table first, then the OPTIONS next. So for each product in the users shopping cart (let's pretend the user is ordering 3 cricket bats, with 3 different sets of options (different sizes, colours etc)) - For each bat, I need to create a record in the options table.
Now I have optionID's 1, 2 and 3.
I now add the product ID's to the "product" column in the orderContents table. How do I tie each produt to the set of options it needs to go with?
If any one can give me so much as an idea on how to do this, I would really appreciate it.
Thanks.