13 Aug 2007
02 Oct 2011
Link to this post
Initially the shopping is strictly handled as 'cart', once you move into the checkout process the 'order' bits come into play.
The 'cart' is (on beginning) not tied to or based on any user, but is session based.
You can try this yourself with a browser which isn't logged in. You can add stuff to your shoppingcart,but as soon as you hit checkout, it asks for a login.
A cart id is created and stored as a cookie (see screenshot 1) as soon as you add something to the shoppingcart.
This shoppingCardId cookie is the GUID referenced in the tables. In [sf_ec_cart_order] its the [id] field and all the subsequent cart tables reference it by the [cart_order_id]. (see screenshot 2)
In the 3rd screenshot you can see a SQL diagram how they connect to each other.
(relationship/referential integrity are strictly to highlight the fields)
As far as I know, the shoppingCardId cookie is strictly a random GUID.