Interface IncludedProductConfigurationService

    • Method Detail

      • populateIncludedProduct

        void populateIncludedProduct​(com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                     IncludedProduct includedProduct,
                                     List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems,
                                     boolean isAdd)
        Populate the IncludedProduct as a dependent item in the provided CartItem. If there is already an item in CartItem.getDependentCartItems() which matches the IncludedProduct, then that will be hydrated with pricing information. Otherwise, a new dependent cart item will be added to represent the IncludedProduct if we are in an add-to-cart flow.
        Parameters:
        cartItem - The CartItem for which to populate the IncludedProduct.
        includedProduct - The IncludedProduct we are populating.
        potentialDependentItems - The list of CartItem.getDependentCartItems() to pick from to find a match for the IncludedProduct.
        isAdd - Whether we are in an add-to-cart flow, which dictates whether to add an unmatched IncludedProduct.
      • validateIncludedProduct

        void validateIncludedProduct​(com.broadleafcommerce.cart.client.domain.CartItem cartItem,
                                     IncludedProduct includedProduct,
                                     List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems)
        Perform validation against the provided CartItem for the given IncludedProduct.
        Parameters:
        cartItem - The CartItem to perform included product validation against.
        includedProduct - The IncludedProduct we are using to validate the cart against.
        potentialDependentItems - The list of dependent cart items to pick from when validating IncludedProduct.