PHP (Session) Cart to Checkout question

Hi Chaps,

I have a really basic shopping cart, which uses Sessions to add/update/delete/write products.

My question is, what’s the best way to transfer the cart/session information to a checkout stage where a user would sign in/sign up, then complete the payment?

I’m guessing that when the user gets to the checkout, an ‘order/order item’ is created, which would need a customer id.

I’m not sure how to link the session cart to a customer/order??

Sorry if this is a bit of a daft question, but I guess it’s beeter to be sure before doing something stupid!


Professional approach would be on checkout
if login is not required
create a form with hidden variables(required varibales) and prsent it to user,allow user to update quantity
(value of other will come from session)
then user clicks on checkout redirect user to thirdparty like paypal
get some acknowledgement from paypal
and approve/verify and all…then update database

if you need to login,keep session varibales unless user logins in or signs up and present the form only after that.

(in case of singup u may need temporary database table if user can still come later verify his account and complete transaction)