I am developing a shopping cart and have come across a problem. I have developed it in such a way that there is two carts, I call them the user_cart and the session_cart,, but they all really go to the same place and are only differentiated by the user_id or the cfid columns (one OR the other). I have developed them this way in case one use may have more than one account without cross-breeding information. When the user logs in, any items in his or her cart are added into their user cart. So you see, it is possible to have product # 5 (we'll say) twice.
I would use the GROUP BY command, but if the user deletes that item he or she would have to delete it more than once.
What I need is a way to look at the items the user has in his or her cart, look at the items in the session_cart and if there are any duplicates to add the quantity together.
To see the current status of my cart look at SomeGuysStuff.com
Thank you.