Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create shopping cart

 
Sachin Kadian
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am designing a website for online shopping. i need the option of " add to shopping cart" . A user can add any item to his shopping cart. how can i do so?? if i do this by creating table in database the how can i create dynamic tables in database?? please suggest me any other option too.. thanhx.
 
Tim Moores
Bartender
Posts: 2687
36
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does adding an item to a shopping cart have to do with creating table? The table should have been created before the web app containing the shopping cart was ever first run, no? Or are you proposing to create a new table for each user? That would be such an unusual design that I would strongly urge you to reconsider.
 
Ernesto Arroyo
Greenhorn
Posts: 11
Java Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, A shopping cart is implemented using Sessions, but I agree with Tim that you have to rethink a little because there are some weird concepts mixed...
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used cookies (as the session was so short) but I am sure I will be shot down for this

Edit: no it wasn't a good example.
 
Ernesto Arroyo
Greenhorn
Posts: 11
Java Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cookie for the shopping cart?

The items should be saved in the server, not in a cookie. Sounds rather weird!
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernesto Arroyo wrote:cookie for the shopping cart?

The items should be saved in the server, not in a cookie. Sounds rather weird!


I needed to keep the cart for users who hadn't logged in yet, so couldn't think how to id them.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Advanced shopping carts will generally use a number of solutions, including cookies, the session, and a database to account for the numerous situations (logged in vs. not logged in, and so on).
 
Alan Smith
Ranch Hand
Posts: 185
Firefox Browser Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out netbeans java e-commerce tutorial. There is a great implementation of one there: netbeans tutorial
 
pravin venkat
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting HTML5 Implementation:

http://www.webdesignermag.co.uk/blog/create-a-shopping-cart-with-html5/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic