Class CartOperationServiceProperties
java.lang.Object
com.broadleafcommerce.cartoperation.service.CartOperationServiceProperties
@ConfigurationProperties("broadleaf.cartoperation.service")
public class CartOperationServiceProperties
extends Object
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Contains properties for bulk add to cart operations from the API.static class
Properties related to the cart approval flow.static class
Properties related to access control of item lists.static class
Contains properties that determine whether certain operations from the API cause prices to be invalidated. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe bulk properties configuration.The cart approval configuration.The amount of time before the cart's pricing is considered stale.The default fulfillment option name for theFulfillmentType.VIRTUAL
fulfillment type.Globally determines how Products should merge with other similar items when they get added to a cart.The offer version enabled for external service calls with CartOperationService.The price invalidation configuration.boolean
Whether the fulfillment pricing should consider the adjustments on the order and order items.boolean
Whether the fulfillment pricing should consider prorated price of the order items, after factoring in the order adjustments.boolean
If there is a configuration error for a cart item when attempting to add it to a cart, fail the attempt.boolean
Iftrue
, the deprecatedCartOperationService.updateCartStatus(Cart, UpdateCartStatusRequest, ContextInfo)
method will be used to update the Cart status.boolean
Deprecated.boolean
When repricing cart, if a new locale has been requested, automatically switch to the default currency for that locale.boolean
When repricing cart, if the currency changes, force an update to catalog pricing.void
setBulkAddToCartOperation
(CartOperationServiceProperties.BulkAddToCartOperation bulkAddToCartOperation) The bulk properties configuration.void
setCalculateFulfillmentPricingWithAdjustments
(boolean calculateFulfillmentPricingWithAdjustments) Whether the fulfillment pricing should consider the adjustments on the order and order items.void
setCalculateProratedFulfillmentPricing
(boolean calculateProratedFulfillmentPricing) Whether the fulfillment pricing should consider prorated price of the order items, after factoring in the order adjustments.void
setCartApproval
(CartOperationServiceProperties.CartApproval cartApproval) The cart approval configuration.void
setCartPricingTimeToLive
(Duration cartPricingTimeToLive) The amount of time before the cart's pricing is considered stale.void
setDefaultVirtualFulfillmentOptionName
(String defaultVirtualFulfillmentOptionName) The default fulfillment option name for theFulfillmentType.VIRTUAL
fulfillment type.void
setFailConfigErrorOnAdd
(boolean failConfigErrorOnAdd) If there is a configuration error for a cart item when attempting to add it to a cart, fail the attempt.void
setItemListSecurity
(CartOperationServiceProperties.ItemListSecurity itemListSecurity) void
setLegacyUpdateCartStatusEnabled
(boolean legacyUpdateCartStatusEnabled) Iftrue
, the deprecatedCartOperationService.updateCartStatus(Cart, UpdateCartStatusRequest, ContextInfo)
method will be used to update the Cart status.void
setMatchCartItemAssetToVariant
(boolean matchCartItemAssetToVariant) Deprecated.since 1.7.3, in favor ofCartItemProductServiceProperties.isMatchCartItemAssetToVariant()
void
setMergingType
(String mergingType) Globally determines how Products should merge with other similar items when they get added to a cart.void
setOfferServicesVersion
(String offerServicesVersion) The offer version enabled for external service calls with CartOperationService.void
setPriceInvalidation
(CartOperationServiceProperties.PriceInvalidation priceInvalidation) The price invalidation configuration.void
setSwitchCurrencyOnLocaleSwitch
(boolean switchCurrencyOnLocaleSwitch) When repricing cart, if a new locale has been requested, automatically switch to the default currency for that locale.void
setUpdateCatalogPricingOnCurrencyChange
(boolean updateCatalogPricingOnCurrencyChange) When repricing cart, if the currency changes, force an update to catalog pricing.
-
Constructor Details
-
CartOperationServiceProperties
public CartOperationServiceProperties()
-
-
Method Details
-
isFailConfigErrorOnAdd
public boolean isFailConfigErrorOnAdd()If there is a configuration error for a cart item when attempting to add it to a cart, fail the attempt. This need to "fail fast" might be required if there isn't a good way to fix the configuration errors after adding to cart. -
isCalculateFulfillmentPricingWithAdjustments
public boolean isCalculateFulfillmentPricingWithAdjustments()Whether the fulfillment pricing should consider the adjustments on the order and order items. -
isCalculateProratedFulfillmentPricing
public boolean isCalculateProratedFulfillmentPricing()Whether the fulfillment pricing should consider prorated price of the order items, after factoring in the order adjustments. -
getDefaultVirtualFulfillmentOptionName
The default fulfillment option name for theFulfillmentType.VIRTUAL
fulfillment type. -
getMergingType
Globally determines how Products should merge with other similar items when they get added to a cart. Will be overridden by merge values on a Product. Out of box supported values are those inDefaultMergingType
. -
getPriceInvalidation
The price invalidation configuration. Controls when prices on a cart or its items are considered invalid when clients use certain API operations. -
getBulkAddToCartOperation
The bulk properties configuration. -
getItemListSecurity
-
getCartApproval
The cart approval configuration. -
getCartPricingTimeToLive
The amount of time before the cart's pricing is considered stale. Once this duration is exceeded, the cart will be fully repriced on its next retrieval. -
getOfferServicesVersion
The offer version enabled for external service calls with CartOperationService. This is useful for maintaining backwards compatibility. If using the latest version, this property does not have to be supplied. -
isMatchCartItemAssetToVariant
Deprecated.since 1.7.3, in favor ofCartItemProductServiceProperties.isMatchCartItemAssetToVariant()
Determines whether theCartItem.getImageAsset()
should match the selectedVariant
if possible instead of theProduct.getPrimaryAsset()
. The matching will be done viaDefaultCartItemCatalogInformationService
if theVariant
hasoptionValues
to use to match with aproduct asset
by tag. -
isSwitchCurrencyOnLocaleSwitch
public boolean isSwitchCurrencyOnLocaleSwitch()When repricing cart, if a new locale has been requested, automatically switch to the default currency for that locale. -
isUpdateCatalogPricingOnCurrencyChange
public boolean isUpdateCatalogPricingOnCurrencyChange()When repricing cart, if the currency changes, force an update to catalog pricing. -
isLegacyUpdateCartStatusEnabled
public boolean isLegacyUpdateCartStatusEnabled()Iftrue
, the deprecatedCartOperationService.updateCartStatus(Cart, UpdateCartStatusRequest, ContextInfo)
method will be used to update the Cart status.This property should be set to
true
only if there are specific needs to do so, for example, for backward compatibility if the newCartOperationService.updateCartStatus(Cart, UpdateCartStatusRequest, CustomerRef, ContextInfo)
method causes any issues and can't be updated/fixed immediately. -
setFailConfigErrorOnAdd
public void setFailConfigErrorOnAdd(boolean failConfigErrorOnAdd) If there is a configuration error for a cart item when attempting to add it to a cart, fail the attempt. This need to "fail fast" might be required if there isn't a good way to fix the configuration errors after adding to cart. -
setCalculateFulfillmentPricingWithAdjustments
public void setCalculateFulfillmentPricingWithAdjustments(boolean calculateFulfillmentPricingWithAdjustments) Whether the fulfillment pricing should consider the adjustments on the order and order items. -
setCalculateProratedFulfillmentPricing
public void setCalculateProratedFulfillmentPricing(boolean calculateProratedFulfillmentPricing) Whether the fulfillment pricing should consider prorated price of the order items, after factoring in the order adjustments. -
setDefaultVirtualFulfillmentOptionName
The default fulfillment option name for theFulfillmentType.VIRTUAL
fulfillment type. -
setMergingType
Globally determines how Products should merge with other similar items when they get added to a cart. Will be overridden by merge values on a Product. Out of box supported values are those inDefaultMergingType
. -
setPriceInvalidation
public void setPriceInvalidation(CartOperationServiceProperties.PriceInvalidation priceInvalidation) The price invalidation configuration. Controls when prices on a cart or its items are considered invalid when clients use certain API operations. -
setBulkAddToCartOperation
public void setBulkAddToCartOperation(CartOperationServiceProperties.BulkAddToCartOperation bulkAddToCartOperation) The bulk properties configuration. -
setItemListSecurity
-
setCartApproval
The cart approval configuration. -
setCartPricingTimeToLive
The amount of time before the cart's pricing is considered stale. Once this duration is exceeded, the cart will be fully repriced on its next retrieval. -
setOfferServicesVersion
The offer version enabled for external service calls with CartOperationService. This is useful for maintaining backwards compatibility. If using the latest version, this property does not have to be supplied. -
setMatchCartItemAssetToVariant
Deprecated.since 1.7.3, in favor ofCartItemProductServiceProperties.isMatchCartItemAssetToVariant()
Determines whether theCartItem.getImageAsset()
should match the selectedVariant
if possible instead of theProduct.getPrimaryAsset()
. The matching will be done viaDefaultCartItemCatalogInformationService
if theVariant
hasoptionValues
to use to match with aproduct asset
by tag. -
setSwitchCurrencyOnLocaleSwitch
public void setSwitchCurrencyOnLocaleSwitch(boolean switchCurrencyOnLocaleSwitch) When repricing cart, if a new locale has been requested, automatically switch to the default currency for that locale. -
setUpdateCatalogPricingOnCurrencyChange
public void setUpdateCatalogPricingOnCurrencyChange(boolean updateCatalogPricingOnCurrencyChange) When repricing cart, if the currency changes, force an update to catalog pricing. -
setLegacyUpdateCartStatusEnabled
public void setLegacyUpdateCartStatusEnabled(boolean legacyUpdateCartStatusEnabled) Iftrue
, the deprecatedCartOperationService.updateCartStatus(Cart, UpdateCartStatusRequest, ContextInfo)
method will be used to update the Cart status.This property should be set to
true
only if there are specific needs to do so, for example, for backward compatibility if the newCartOperationService.updateCartStatus(Cart, UpdateCartStatusRequest, CustomerRef, ContextInfo)
method causes any issues and can't be updated/fixed immediately.
-
CartItemProductServiceProperties.isMatchCartItemAssetToVariant()