Interface CartItemConfigurationService<P extends CatalogItem>
-
- All Known Implementing Classes:
DefaultCartItemConfigurationService
public interface CartItemConfigurationService<P extends CatalogItem>- Author:
- Chad Harchar (charchar)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancartItemHasQuantityThresholds(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList)Determines if the providedCartItem'srelatedCatalogItemhas quantity threshold restrictions.voidvalidateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItemList<? extends CatalogItem> catalogItemList, String validationFlow)Process cart item configuration by validating catalog information.voidvalidateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItem catalogItem, String validationFlow)Process cart item configuration by validating catalog information.
-
-
-
Method Detail
-
cartItemHasQuantityThresholds
default boolean cartItemHasQuantityThresholds(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList)Determines if the providedCartItem'srelatedCatalogItemhas quantity threshold restrictions.- Parameters:
cartItem- TheCartItemthat we need to check for quantity thresholds.catalogItemList- TheCatalogItemListthat should contain theCartItem'srelatedCatalogItem.- Returns:
- If the provided
CartItem'srelatedCatalogItemhas quantity threshold restrictions.
-
validateCartItem
void validateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItemList<? extends CatalogItem> catalogItemList, String validationFlow)Process cart item configuration by validating catalog information. Errors for the item will be recorded intoCartItem.getGlobalConfigErrors(), while errors for specific attributes will be recorded intoCartItem.getAttributeConfigErrors(). For hierarchical cart items (items withCartItem.getDependentCartItems()) it is intended that this method be called from the bottom up, i.e., the lowest level dependent item gets called first. That way, errors on items will be properly cascaded up the hierarchy asCartItemConfigurationErrorEnum.MISCONFIGURED_DEPENDENT_ITEMSonCartItem.getGlobalConfigErrors().- Parameters:
cart- The cart with the cart itemcartItem- The cart item with which to process configuration.catalogItemList- TheCatalogItemListthat should contain theCartItem'srelatedCatalogItem.validationFlow- The context used to identify validation requirements of theCartItemat that point in its lifecycle. If this is set toValidationStrategy.ADD_ITEM, then the configuration service will try to
-
validateCartItem
void validateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItem catalogItem, String validationFlow)Process cart item configuration by validating catalog information. Errors for the item will be recorded intoCartItem.getGlobalConfigErrors(), while errors for specific attributes will be recorded intoCartItem.getAttributeConfigErrors(). For hierarchical cart items (items withCartItem.getDependentCartItems()) it is intended that this method be called from the bottom up, i.e., the lowest level dependent item gets called first. That way, errors on items will be properly cascaded up the hierarchy asCartItemConfigurationErrorEnum.MISCONFIGURED_DEPENDENT_ITEMSonCartItem.getGlobalConfigErrors().- Parameters:
cart- The cart with the cart itemcartItem- The cart item with which to process configuration.catalogItem- TheCatalogItemwith configuration to be used for validation.validationFlow- The context used to identify validation requirements of theCartItemat that point in its lifecycle. If this is set toValidationStrategy.ADD_ITEM, then the configuration service will try to
-
-