|
hi guys just want to pick ur brains again
ive created a login system on my site using sessions. which as a normal login system searches a database for the user if they are present it then starts the sessions $_SESSION['name'] and $_SESSION['user_id'];
on my shopping cart i start a session called cart which contains the product id, quantity, product name and cost. as well as this it contains the total and a few other calculations..
now i havent in any way linked these two together as of yet and this is what im trying to get my head around really
when the user logs in and then they go to browse my products they have aleady started a session, so could i link the session cart to this session, and if so how would you go about this,, the main reason for really doing this is i was thinking of having a save feature in the cart much like amazon do where the user logs in and then can save the cart to a database called temp orders which then contains there id,product id etc, when they login again i could do a simple query to check they are logged in and there id and then check the database and then if so add there saved items to the correct section of the cart.
do you guys think that this might be a complicated task or with what i already have in place shouldnt be that difficult
thanks
|