Click here to Skip to main content
15,922,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to keep history of all purchases by loginid in online shopping website

Have a table (or tables) in your DB which holds "historic" orders: when the user places the order you add the data to it, complete with a datestamp and references to products.

To be honest, you probably don't need to do this: you already have the order history in the shape of existing invoices - which most companies must keep for a certain number of years anyway so the tax authorities can examine them if they feel the need.
Share this answer
Depends on what the business requirement is.

If you want to store the shopping data temporarily (i.e. for that session), then use an in memory store like a collection or dictionary etc.

If the user should see this shopping data next time he logs in, you will need to use a database to store this information.
Next time the same user logs in, display the old shopping list.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900