Interface CartItemConfigurationService<P extends CatalogItem>
- All Known Implementing Classes:
DefaultCartItemConfigurationService
public interface CartItemConfigurationService<P extends CatalogItem>
- Author:
- Chad Harchar (charchar)
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancartItemHasQuantityThresholds(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList) Deprecated, for removal: This API element is subject to removal in a future version.booleancartItemHasQuantityThresholds(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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) Deprecated, for removal: This API element is subject to removal in a future version.default voidvalidateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItem catalogItem, String validationFlow, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Process cart item configuration by validating catalog information.voidvalidateCustomQuoteItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem) Deprecated, for removal: This API element is subject to removal in a future version.default voidvalidateCustomQuoteItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Processes item configuration validation for custom quote items.voidvalidateNonCatalogItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Processes item configuration validation for non-catalog items.booleanvariantCartItemMissingFromCatalogItem(@NonNull CatalogItemList<? extends CatalogItem> catalogItemList, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the providedCartItemdoes not have a backingVariantfrom the list ofCatalogItemThis specifically targets Variants by checking the variant ID of a cart item.
-
Method Details
-
cartItemHasQuantityThresholds
@Deprecated(since="2.1.3", forRemoval=true) default boolean cartItemHasQuantityThresholds(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList) Deprecated, for removal: This API element is subject to removal in a future version.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.
-
cartItemHasQuantityThresholds
boolean cartItemHasQuantityThresholds(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the providedCartItem'srelatedCatalogItemhas quantity threshold restrictions.- Parameters:
cartItem- TheCartItemthat we need to check for quantity thresholds.catalogItemList- TheCatalogItemListthat should contain theCartItem'srelatedCatalogItem.contextInfo- Context information around sandbox and multitenant state.- 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, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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 tocontextInfo- Context information around sandbox and multitenant state.
-
validateCartItem
@Deprecated(since="2.1.3", forRemoval=true) void validateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItem catalogItem, String validationFlow) Deprecated, for removal: This API element is subject to removal in a future version.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
-
validateCartItem
default void validateCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, CatalogItem catalogItem, String validationFlow, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 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 tocontextInfo- Context information around sandbox and multitenant state.
-
validateCustomQuoteItem
@Deprecated(since="2.1.3", forRemoval=true) void validateCustomQuoteItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem) Deprecated, for removal: This API element is subject to removal in a future version.Processes item configuration validation for custom quote items.Any customization should be added here.
- Parameters:
cart- The cart with the cart itemcartItem- The cart item with which to process configuration- See Also:
-
DefaultCartItemTypes.CUSTOM_QUOTE_ITEM
-
validateCustomQuoteItem
default void validateCustomQuoteItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Processes item configuration validation for custom quote items.Any customization should be added here.
- Parameters:
cart- The cart with the cart itemcartItem- The cart item with which to process configurationcontextInfo- Context information around sandbox and multitenant state.- See Also:
-
DefaultCartItemTypes.CUSTOM_QUOTE_ITEM
-
validateNonCatalogItem
void validateNonCatalogItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Processes item configuration validation for non-catalog items.Any customization should be added here.
- Parameters:
cart- The cart with the cart itemcartItem- The cart item with which to process configurationcontextInfo- Context information around sandbox and multitenant state.- See Also:
-
DefaultCartItemTypes.NON_CATALOG_ITEM
-
variantCartItemMissingFromCatalogItem
boolean variantCartItemMissingFromCatalogItem(@NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the providedCartItemdoes not have a backingVariantfrom the list ofCatalogItemThis specifically targets Variants by checking the variant ID of a cart item.- Parameters:
catalogItemList- the list ofCatalogItemscartItem- the cart item to checkcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- true if the
cartItemdoes not have a backingVariantfor a variant
-
cartItemHasQuantityThresholds(CartItem, CatalogItemList, ContextInfo)