Class CartItem

java.lang.Object
com.jahnreil_stratpoint.model.CartItem

public class CartItem extends Object
The CartItem class represents an item in the shopping cart. It holds a reference to a Product, the quantity of the product, and the total price. The CartItem must be constructed with all arguments.
  • Constructor Details

    • CartItem

      public CartItem()
  • Method Details

    • calculateTotal

      public BigDecimal calculateTotal()
      Calculates the total price for the CartItem based on the product price and quantity. The totalPrice is reset to 0 before recalculating.
      Returns:
      the total price of the CartItem