I am working on a iPad ordering web app at the moment which consists of different pieces of clothing. The linesheet will be built like this:
20-30 different product will be shown in the same form. Every product have five different sizes to choose from and every size has a different quantity depending on what the buyer would like to order.
I have a products table with the following columns:
id
product_number
product_name
product_size
product_color
product_description
product_image
product_title
product_category
product_composition
product_price_wholesale_dkk
product_price_wholesale_eur
product_price_retail_dkk
product_price_retail_eur
product_active
product_detail_one
product_detail_two
product_detail_three
product_xsmall (activate size for this product? is it avail.)
product_small (activate size for this product? is it avail.)
product_medium (activate size for this product? is it avail.)
product_large (activate size for this product? is it avail.)
product_xlarge (activate size for this product? is it avail.)
and an orders table with the following columns:
id
order_store
order_reference
order_mail
order_payment_details
order_products
order_value_total_wholesale_dkk
order_value_total_retail_dkk
order_value_total_wholesale_eur
order_value_total_retail_eur
order_date
order_phone
order_VAT
order_address
order_comments
order_product_numbers
order_product_pieces
order_store_country
My problem is that I can't figure out how the database should be set up. When the order confirmation is sent to the buyer every product should be listed with the specific number of sizes for every product, and since every size might or might not be selected it needs to identify which ones has been chosen and how many of the particular size for the particular product.
How will I be able to make the system check first of all which sizes for the specific product has been ordered and then next how many of that size (database wise) and then PHP wise when choosing the tables in my script?
Thanks in advance.