Class AbstractCommerceCartStrategy

    • Field Detail

      • DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY

        protected static final long DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY
        See Also:
        Constant Field Values
      • forceInStockMaxQuantity

        protected long forceInStockMaxQuantity
    • Constructor Detail

      • AbstractCommerceCartStrategy

        public AbstractCommerceCartStrategy()
    • Method Detail

      • getAllowedCartAdjustmentForProduct

        protected long getAllowedCartAdjustmentForProduct​(CartModel cartModel,
                                                          ProductModel productModel,
                                                          long quantityToAdd,
                                                          PointOfServiceModel pointOfServiceModel)
        Work out the allowed quantity adjustment for a product in the cart given a requested quantity change.
        Parameters:
        cartModel - the cart
        productModel - the product in the cart
        quantityToAdd - the amount to increase the quantity of the product in the cart, may be negative if the request is to reduce the quantity
        pointOfServiceModel - the PointOfService to check stock at, can be null
        Returns:
        the allowed adjustment
      • isStockLevelSufficient

        protected boolean isStockLevelSufficient​(CartModel cartModel,
                                                 ProductModel productModel,
                                                 PointOfServiceModel pointOfServiceModel,
                                                 long quantityToAdd)
        Work out if the stock level is sufficient for a product in the cart given a requested quantity change.
        Parameters:
        cartModel - the cart
        productModel - the product in the cart
        pointOfServiceModel - the PointOfService to check stock at, can be null
        quantityToAdd - the amount to increase the quantity of the product in the cart, may be negative if the request is to reduce the quantity
        Returns:
        the allowed adjustment
      • isMaxOrderQuantitySet

        protected boolean isMaxOrderQuantitySet​(java.lang.Integer maxOrderQuantity)
      • normalizeEntryNumbers

        protected void normalizeEntryNumbers​(CartModel cartModel)
      • setProductService

        public void setProductService​(ProductService productService)
      • getCartService

        protected CartService getCartService()
      • setCartService

        public void setCartService​(CartService cartService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • setCommerceStockService

        public void setCommerceStockService​(CommerceStockService commerceStockService)
      • setBaseStoreService

        public void setBaseStoreService​(BaseStoreService baseStoreService)
      • getForceInStockMaxQuantity

        protected long getForceInStockMaxQuantity()
      • setForceInStockMaxQuantity

        public void setForceInStockMaxQuantity​(long forceInStockMaxQuantity)
      • getCartEntryDao

        protected CartEntryDao getCartEntryDao()
      • setCartEntryDao

        public void setCartEntryDao​(CartEntryDao cartEntryDao)