CodePudding user response:
http://download.csdn.net/detail/defonds/7075047CodePudding user response:
Add items to the redis,CodePudding user response:
My small white, I do is simple:1. Add the goods send a request to the id, the servlet layer calls business logic for the database object
2. Use the Map collection object as a transport container, and the key of 1 for in the database object, the value for the number, to add the same goods, in the second or more should put the id of the javabean rewrite hashcode, judge whether the goods contains the id, contains the value + 1 (the value itself is a String type, is converted to Int, throw in a
) or it will cause the Map it will generate multiple repeated commodity
3. Map collections in the session, in the cart. The JSPS traverse the session parameters in domain objects
CodePudding user response:
Analysis: shopping cart can look after each login, so shopping cart data is stored in database tables, shoppingCar, at least have a product ID, quantity, price information to redirect users click on the shopping cart on the product ID real-time query, then the number of price, it is concluded that the total price to generate orders, two parameters obtained from the shopping cart or commodity ID number, unit price and total price must recalculate, generate an order, or false delete delete shopping cart dataCodePudding user response:
Goods first, you should add an item id, and then, when users click on add to create a orders to save database, and this order with this match, if users to add the number 1, then you pass judgment commodity id to show changes, become number 2, and any other information without having to make a DIV, these all need in JS judgment, you said all prices need to calculation the JS, until finally the user to confirm saved to the database, this need to order a status field,CodePudding user response:
If not high demand by the sessionCodePudding user response:
Man, a man a little more, a lot more, more, more and more