Interface IncludedProductConfigurationService
- All Known Implementing Classes:
DefaultIncludedProductConfigurationService
public interface IncludedProductConfigurationService
- Author:
- Chad Harchar (charchar)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
populateIncludedProduct
(com.broadleafcommerce.cart.client.domain.CartItem cartItem, IncludedProduct includedProduct, List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems, boolean isAdd) Populate theIncludedProduct
as a dependent item in the providedCartItem
.void
validateIncludedProduct
(com.broadleafcommerce.cart.client.domain.CartItem cartItem, IncludedProduct includedProduct, List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems) Perform validation against the providedCartItem
for the givenIncludedProduct
.
-
Method Details
-
populateIncludedProduct
void populateIncludedProduct(com.broadleafcommerce.cart.client.domain.CartItem cartItem, IncludedProduct includedProduct, List<com.broadleafcommerce.cart.client.domain.CartItem> potentialDependentItems, boolean isAdd) Populate theIncludedProduct
as 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 theIncludedProduct
if we are in an add-to-cart flow.- Parameters:
cartItem
- TheCartItem
for which to populate theIncludedProduct
.includedProduct
- TheIncludedProduct
we 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 providedCartItem
for the givenIncludedProduct
.- Parameters:
cartItem
- TheCartItem
to performincluded product
validation against.includedProduct
- TheIncludedProduct
we are using to validate the cart against.potentialDependentItems
- The list ofdependent cart items
to pick from when validatingIncludedProduct
.
-