I have searched google, but the sheer variety of tutorials available is a little daunting, plus they all seem to use different methods. Some use sessions, while some store the cart in either a new or existing database table.
Also, from what I can tell they often seem to store just a single product id. What I need the cart to store however are multiple product ids for each item.
For example each order item will be made up of:
bread_id
style_id
and then up to 6
filling_id
I was thinking of storing them as an array in a session variable so it stored them like so:
bread_id, style_id, filling_id1, filling_id2, filling_id3, filling_id4, filling_id5, filling_id6
'0001', '002', '004', '003', '011', '012', '', ''
'0002', '007', '012', '024', '001', '009', '006', '032'
'0002', '003', '004', '002', '', '', '', ''
Do I have a correct understanding of sessions and would this work? I was then hoping to be able to extract them to retrieve the individual components of each sandwich ordered so I could display them on the shopping cart page and eventually use them to complete the order?