using javascript to add item(s) to cart
I am playing around with jquery, using sortable with connected lists - to drag and drop elements into a list which I want to use as a 'pre-cart' so that when I add an add to cart behavior to my page, it takes all elements from my list and adds them to the cart.
I can store the 'pre cart' elements in a js array, and also store them in a cookie, but haven't worked out how to add them to the cart.
I guess that clicking the add to cart button will reload the page, so I need to store the elements in a cookie or session variable, (haven't worked the session variable bit out yet, but I can store a cookie ok).
Then I guess that when the page reloads, I take my cookie/session string values, and pass the values into the cart using a do while loop ?
Is this a sensible approach ?
Grateful for any ideas/advice