Class CartController
java.lang.Object
com.jahnreil_stratpoint.controller.CartController
Controller class for managing operations related to the shopping cart.
-
Constructor Summary
ConstructorDescriptionCartController
(Cart cart) Constructor to initialize the CartController with a cart instance. -
Method Summary
-
Constructor Details
-
CartController
Constructor to initialize the CartController with a cart instance.- Parameters:
cart
- The cart instance to be managed by this controller.
-
-
Method Details
-
addToCart
Adds a selected product to the shopping cart.- Parameters:
cart
- The current cart instance.products
- List of available products to choose from.- Returns:
- Updated cart instance after adding the product.
-
viewCart
Displays the contents of the shopping cart and handles user interactions.- Parameters:
products
- List of available products for displaying cart items.
-