Interface AddToCartStrategy

  • All Known Implementing Classes:
    DefaultAddToCartStrategy

    @Deprecated
    public interface AddToCartStrategy
    Deprecated.
    since ages
    The product add to cart strategy.
    Spring Bean ID:
    addToCartStrategy
    • Method Detail

      • addToCart

        void addToCart​(CartModel cart,
                       ProductModel product,
                       long quantity,
                       UnitModel unit)
                throws InvalidCartException
        Deprecated.
        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.
        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)