Users select the books they want, they press add to cart and that triggers a form that gives the list of ISBNs to a post controller method which: 1. saves the ids to the session but as a set of ids (only if not in list) 2. redirects back to the same page. Then using Thymeleaf you can get the size of the list from the session and display a number beside the cart in brackets indicating the number of books in the cart
Requirements:
Add a session object for holding books in cart
Add a form and JS to front end of books page to add books to cart (includes adding button)
Users select the books they want, they press add to cart and that triggers a form that gives the list of ISBNs to a post controller method which: 1. saves the ids to the session but as a set of ids (only if not in list) 2. redirects back to the same page. Then using Thymeleaf you can get the size of the list from the session and display a number beside the cart in brackets indicating the number of books in the cart
Requirements: Add a session object for holding books in cart Add a form and JS to front end of books page to add books to cart (includes adding button)