[eluser]happydude[/eluser]
I know the manual dwells a lot on this, but I really some clarification here.
I have a many to many relationship between sales and products table. On the join table (sales_products), an extra field 'quantity' is added so I have: id, sale_id, product_id, quantity.
On my form, the user can select different products and enter corresponding quantity they want to order.
This form block is replicated multiple times (more of a data entry grid).
In my code, how do I save all the products coming in from the form such that the sales table and the sales_products table are appropriately populated.
Also, when querying the sales table ($sale->get()), I want the 'quantity' field in the sales_products table be a part of the results. How do I achieve this?
Thanks in advance (and sorry if the question is noobish. )