Hi there,
I got a problem using grocerycrud, the saturation as below:
Tables:
product (p_id, p_name, p_desc)
color (c_id, c_name)
size (s_id, s_name)
product_color (pc_id, product_id, color_id)
product_size (ps_id, product_id, size_id)
stock (stock_id, pc_id, ps_id, in_stock)
Rule:
- A product can multi-color (relate product_color to store p_id and c_id)
- A product can multi-size (relate product_size to store p_id and s_id)
- "Stock" table store a particular "size" and "color" in a product inventory
Master List
the function of add/update/delete on "product","color","size" is work perfectly.
the set_relation_n_n for "product_color" and "product_size" is work perfect too.
Example:
Product "PoloTee001" have two size, "M" and "L", also, the yellow color of "M" size "PoloTee001" inventory had 5 pcs and the yellow color of "L" size "PoloTee001" inventory had 8 pcs
The Ideal Result:
Table "Stock"
stock_id, pc_id, ps_id, in_stock
5, 2 , 1 , 5
5, 2 , 2 , 8
assumption:
stock_id 5 is "PoloTee001" ID
pc_id 2 is "Yellow" color in product "PoloTee001"
ps_id 1 is "M" size and 2 is "L" size in product "PoloTee001"
Problem!!!
how can i set the stock table for user to input the product inventory?
Thanks.