Class DefaultAddToCartStrategy

    • Constructor Detail

      • DefaultAddToCartStrategy

        public DefaultAddToCartStrategy()
    • Method Detail

      • addToCart

        @Deprecated(since="ages",
                    forRemoval=true)
        public void addToCart​(CartModel cart,
                              ProductModel product,
                              long quantity,
                              UnitModel unit)
                       throws InvalidCartException
        Deprecated, for removal: This API element is subject to removal in a future version.
        since ages
        Description copied from interface: AddToCartStrategy
        Adds to the (existing) CartModel the (existing) ProductModel in the given UnitModel and with the given quantity. If in the cart already an entry with the given product and given unit exists the given quantity is added to the the quantity of this cart entry.
        Specified by:
        addToCart in interface AddToCartStrategy
        Parameters:
        cart - the cart, must exist
        product - the product which is added to the cart
        quantity - the quantity of the product
        unit - if null ProductService.getOrderableUnit(ProductModel) is used to determine the unit
        Throws:
        InvalidCartException - if the product is a base product OR the quantity is less 1 or no usable unit was found (only when given unit is also null)
      • setProductService

        public void setProductService​(ProductService productService)