Hello,
I am creating a basic shopping cart. I have the following method of creating the cart in my mind. I would like to know if this is how the standards work or if there's some other better option available:
My way of how cart works:
Create 2 tables in database named "orders" and "orders_content".
When user presses Add to Cart button then the product is added into the "orders_content" table with user's current session id so we recognize its this user's items.
After adding item(s) into the cart using the way above then when user presses the checkout button we ask their details like shipping / billing details and add those details are entered into the "orders" table and the "orders" table has a autonumber field and the generated number is taken and we overwrite the session id (we stored for items in orders_content table) with this auto generated number.
Now as we have a order number which is unique and generated by system we take the user to the payment page and process payments accordingly.
The only flaw this system has that once the user has crossed the checkout part and we have replaced session id with order id then if user presses their browser's back button they cannot see their products they added to cart becuase our system is trying to find the particular user's product using session id ...but as we have replaced it with order id so the system cannot find it and user cannot see them.
Please let me know your thoughts on this one. If you have something better then please let me know your concept or the way standard shopping cart sytems work.
Please note that we don't want user to register...its come, choose, enter details and pay.
Thanks.






Bookmarks