The cookie saves the guid on the cart table, this is encrypted on the cookie. When the cart is made into an order the orderid is placed on the cart.
Be careful what your doing here with the cart table, the cart records are only temporary, that are purged by the scheduler on completion of the order.
Be careful what your doing here with the cart table, the cart records are only temporary, that are purged by the scheduler on completion of the order.