Adding to Cart

Hello, I am developing a Basic application to serve as the customer interface shopping from a list of products. I would be very grateful if someone could direct me to the best way of retrieving the “selected” items to bring it to the cart page.   Thank you in advance, Lucas Fernandes
1 answers

First important step: have the correct datamodel. Entity Cart and entity Article with a *-* association. Create a cart-object before or at the moment that your customer starts browsing. When she puts an article in the cart, associate the two.

Now you have the option to retrieve the selected articles for your customer. 

Btw, the cart can be non-persistent if you don’t want to clean up the cart after the customer has ended her session. But most retailers keep the carts, then persistent is needed.