Interface IncludedProductConfigurationService
-
- All Known Implementing Classes:
DefaultIncludedProductConfigurationService
public interface IncludedProductConfigurationService- Author:
- Chad Harchar (charchar)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidpopulateIncludedProduct(com.broadleafcommerce.cart.client.domain.CartItem cartItem, IncludedProduct includedProduct, List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems, boolean isAdd)Populate theIncludedProductas a dependent item in the providedCartItem.voidvalidateIncludedProduct(com.broadleafcommerce.cart.client.domain.CartItem cartItem, IncludedProduct includedProduct, List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems)Perform validation against the providedCartItemfor the givenIncludedProduct.
-
-
-
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 theIncludedProductas a dependent item in the providedCartItem. If there is already an item inCartItem.getDependentCartItems()which matches theIncludedProduct, then that will be hydrated with pricing information. Otherwise, a new dependent cart item will be added to represent theIncludedProductif we are in an add-to-cart flow.- Parameters:
cartItem- TheCartItemfor which to populate theIncludedProduct.includedProduct- TheIncludedProductwe are populating.potentialDependentItems- The list ofCartItem.getDependentCartItems()to pick from to find a match for theIncludedProduct.isAdd- Whether we are in an add-to-cart flow, which dictates whether to add an unmatchedIncludedProduct.
-
validateIncludedProduct
void validateIncludedProduct(com.broadleafcommerce.cart.client.domain.CartItem cartItem, IncludedProduct includedProduct, List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems)Perform validation against the providedCartItemfor the givenIncludedProduct.- Parameters:
cartItem- TheCartItemto performincluded productvalidation against.includedProduct- TheIncludedProductwe are using to validate the cart against.potentialDependentItems- The list ofdependent cart itemsto pick from when validatingIncludedProduct.
-
-