Class DefaultCartPricingService
- All Implemented Interfaces:
CartPricingService
- Author:
- Chad Harchar (charchar)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCartPricingService(CartItemPricingUtils cartItemPricingUtils, CartProvider cartProvider, PricingProvider pricingProvider, OfferProvider offerProvider, CatalogProvider<? extends CatalogItem> catalogProvider, CartItemConfigurationService<? extends CatalogItem> cartItemConfigurationService, TaxService taxService, FulfillmentPricingService fulfillmentPricingService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CartTotalsCalculator cartTotalsCalculator, CartPricingRoundingHelper roundingHelper, CartOperationServiceProperties cartOperationServiceProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, org.springframework.context.MessageSource messageSource) DefaultCartPricingService(CartItemPricingUtils cartItemPricingUtils, CartProvider cartProvider, PricingProvider pricingProvider, OfferProvider offerProvider, CatalogProvider<? extends CatalogItem> catalogProvider, TaxService taxService, FulfillmentPricingService fulfillmentPricingService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CartTotalsCalculator cartTotalsCalculator, CartPricingRoundingHelper roundingHelper, CartOperationServiceProperties cartOperationServiceProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, org.springframework.context.MessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.cart.client.domain.CartapplyPricesToCart(com.broadleafcommerce.cart.client.domain.Cart cart, CatalogItemList<? extends CatalogItem> catalogItemList) protected voidapplyTaxes(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimate, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Applies taxes for the givenCart.protected CatalogItemRequestbuildCatalogItemRequest(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to create theCatalogItemRequestand populate any additional attributes that should be passed to theCatalogProviderwhen fetching the catalog representation for the cart item.protected Collection<CatalogItemRequest>buildCatalogItemRequests(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected PriceCartRequestbuildPriceCartRequest(com.broadleafcommerce.cart.client.domain.Cart cart) protected booleancalculateItemSubtotal(boolean shouldPriceCart, com.broadleafcommerce.cart.client.domain.CartItem item, javax.money.CurrencyUnit expectedCurrency) Deprecated.protected booleancalculateItemSubtotal(com.broadleafcommerce.cart.client.domain.Cart cart, boolean shouldPriceCart, com.broadleafcommerce.cart.client.domain.CartItem item, javax.money.CurrencyUnit expectedCurrency) protected voidcalculateProratedFulfillmentPricing(com.broadleafcommerce.cart.client.domain.Cart cart) Calculates the prorated fulfillment pricing for the givenCart, by populating theCartItem.getProratedOrderOfferAdjustments()toFulfillmentItem.getProratedOrderAdjustments().voidcalculateTotals(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Calculate the totals for the cart.protected booleancatalogItemRequestAlreadyExist(@NonNull Set<CatalogItemRequest> catalogItemRequests, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to prevent duplicateCatalogItemRequestsfrom being built based on theCartItem.protected com.broadleafcommerce.pricing.client.domain.PriceInfocleanPriceInfo(@NonNull com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) protected voidclearCartPrices(com.broadleafcommerce.cart.client.domain.Cart cart) protected voidclearFulfillmentPricing(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) protected voidclearItemPricing(com.broadleafcommerce.cart.client.domain.CartItem ci) protected voiddetermineTaxableAmounts(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Determines and setsFulfillmentItem.getMerchandiseTaxableAmount()andFulfillmentGroup.getFulfillmentTaxableAmount().protected StringdetermineTaxCalculationStrategy(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to determine theTaxCalculationStrategybased on the givenCart.protected BroadleafProductService<Product>protected CartItemConfigurationService<? extends CatalogItem>protected CartItemPricingUtilsprotected CartOperationServicePropertiesprotected CartOperationServiceOfferUtilsprotected CartProviderprotected CartTotalsCalculatorprotected StringgetCatalogItemKeyFromCartItem(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Hook point to determine what the catalog item is keyed on from theCartItem.protected CatalogProvider<? extends CatalogItem>protected javax.money.CurrencyUnitgetCurrencyFromCart(com.broadleafcommerce.cart.client.domain.Cart cart) protected FulfillmentPricingServiceprotected org.springframework.context.MessageSourceprotected com.fasterxml.jackson.databind.ObjectMapperprotected OfferProviderprotected com.broadleafcommerce.pricing.client.domain.context.PriceContextgetPriceContext(Locale locale, javax.money.CurrencyUnit currency) protected StringgetPricingKey(CatalogItem catalogItem, com.broadleafcommerce.cart.client.domain.CartItem cartItem) Returns the catalog item's pricing key, if specified, otherwise retrieves it from the cart item or generates a new one.protected PricingProviderprotected CartPricingRoundingHelperprotected StaleCartItemsServiceprotected TaxServiceprotected com.broadleafcommerce.common.extension.TypeFactoryprotected voidprepareCartForPricing(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.CartpriceCart(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, boolean update, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Price the cart with the provided locale and currency.com.broadleafcommerce.cart.client.domain.CartpriceCart(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Price the cart with the provided locale and currency.voidpriceCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.CartpriceCartWithCatalogPriceUpdates(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reprice the cart, including applying the latest catalog-based prices for each of its itemsprotected voidprorateOrderAdjustments(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.FulfillmentItem> fulfillmentItems, @NonNull javax.money.MonetaryAmount adjustmentsTotal) Deprecated, for removal: This API element is subject to removal in a future version.since 1.7.2, adjustment prorations are now done in OfferServicesvoidsetBroadleafProductService(BroadleafProductService<Product> broadleafProductService) voidsetCartOpsServiceOfferUtils(CartOperationServiceOfferUtils cartOpsServiceOfferUtils) protected voidsetDefaultsForPriceCartRequest(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest) voidsetStaleCartItemsService(StaleCartItemsService staleCartItemsService) protected booleanupdateCartItemPricing(com.broadleafcommerce.cart.client.domain.Cart cart, Locale locale, javax.money.CurrencyUnit expectedCurrency, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected booleanupdateCartItemPricing(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, Locale locale, javax.money.CurrencyUnit expectedCurrency, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected com.broadleafcommerce.cart.client.domain.CartupdateCatalogPricesForCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.CartupdateCatalogPricesForCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.protected <T extends com.broadleafcommerce.cart.client.domain.CartItem>
voidupdateTaxableAmounts(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.FulfillmentGroup> fulfillmentGroups, @NonNull Collection<T> cartItems) Updates the taxable amount fields onFulfillmentItem.protected final javax.money.MonetaryAmountzeroIfNull(javax.money.MonetaryAmount amount, javax.money.CurrencyUnit currency) Defaults theamountto zero if null.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.cartoperation.service.pricing.CartPricingService
priceCart, priceCartItems
-
Constructor Details
-
DefaultCartPricingService
public DefaultCartPricingService(CartItemPricingUtils cartItemPricingUtils, CartProvider cartProvider, PricingProvider pricingProvider, OfferProvider offerProvider, CatalogProvider<? extends CatalogItem> catalogProvider, TaxService taxService, FulfillmentPricingService fulfillmentPricingService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CartTotalsCalculator cartTotalsCalculator, CartPricingRoundingHelper roundingHelper, CartOperationServiceProperties cartOperationServiceProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, org.springframework.context.MessageSource messageSource) -
DefaultCartPricingService
public DefaultCartPricingService(CartItemPricingUtils cartItemPricingUtils, CartProvider cartProvider, PricingProvider pricingProvider, OfferProvider offerProvider, CatalogProvider<? extends CatalogItem> catalogProvider, CartItemConfigurationService<? extends CatalogItem> cartItemConfigurationService, TaxService taxService, FulfillmentPricingService fulfillmentPricingService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, CartTotalsCalculator cartTotalsCalculator, CartPricingRoundingHelper roundingHelper, CartOperationServiceProperties cartOperationServiceProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, org.springframework.context.MessageSource messageSource)
-
-
Method Details
-
priceCart
public com.broadleafcommerce.cart.client.domain.Cart priceCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartPricingServicePrice the cart with the provided locale and currency.- Specified by:
priceCartin interfaceCartPricingService- Parameters:
cart- The cart on which to perform the operation.priceCartRequest- optional info to be used when deciding how to price the cartcontextInfo- the context info- Returns:
- the priced cart
-
priceCartWithCatalogPriceUpdates
public com.broadleafcommerce.cart.client.domain.Cart priceCartWithCatalogPriceUpdates(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartPricingServiceReprice the cart, including applying the latest catalog-based prices for each of its items- Specified by:
priceCartWithCatalogPriceUpdatesin interfaceCartPricingService- Parameters:
cart- The cart on which to perform the operation.contextInfo- the context info- Returns:
- the priced cart
-
calculateProratedFulfillmentPricing
protected void calculateProratedFulfillmentPricing(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Calculates the prorated fulfillment pricing for the givenCart, by populating theCartItem.getProratedOrderOfferAdjustments()toFulfillmentItem.getProratedOrderAdjustments().If there are multiple
FulfillmentItemsfor one singleCartItem, the prorated order offer adjustments are split across all theFulfillmentItemsbased onFulfillmentItem.getQuantity().- Parameters:
cart- theCartto calculate the prorated fulfillment pricing for
-
updateCatalogPricesForCartItems
@Deprecated(forRemoval=true) protected com.broadleafcommerce.cart.client.domain.Cart updateCatalogPricesForCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version. -
updateCatalogPricesForCartItems
protected com.broadleafcommerce.cart.client.domain.Cart updateCatalogPricesForCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
applyPricesToCart
protected com.broadleafcommerce.cart.client.domain.Cart applyPricesToCart(com.broadleafcommerce.cart.client.domain.Cart cart, CatalogItemList<? extends CatalogItem> catalogItemList) -
cleanPriceInfo
protected com.broadleafcommerce.pricing.client.domain.PriceInfo cleanPriceInfo(@NonNull @NonNull com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) -
getPricingKey
protected String getPricingKey(CatalogItem catalogItem, com.broadleafcommerce.cart.client.domain.CartItem cartItem) Returns the catalog item's pricing key, if specified, otherwise retrieves it from the cart item or generates a new one. This in general only needed for theDefaultProductType.MERCHANDISING_PRODUCTas it doesn't have the SKU and pricing key.- Parameters:
catalogItem- the catalog item to get the pricing key fromcartItem- the cart item to get the pricing key from- Returns:
- the pricing key
-
priceCart
public com.broadleafcommerce.cart.client.domain.Cart priceCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, boolean update, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartPricingServicePrice the cart with the provided locale and currency.- Initialize pricing request
- Clear current pricing information from cart
- Update cart item pricing
- Retrieve prices from the pricing provider
- Calculate each item's subtotal
- Record whether each item was priced
- If the items were all priced, continue, otherwise mark the cart as un-priced, update, and return
- Calculate fulfillment pricing by calling the fulfillment pricing provider
- Apply adjustments by calling the offer provider
- Calculate the cart totals
- Record the cart as priced, update (if specified), and return
- Specified by:
priceCartin interfaceCartPricingService- Parameters:
cart- The cart on which to perform the operation.priceCartRequest- optional info to be used when deciding how to price the cartupdate- whether to update (save) the cart after pricingcontextInfo- the context info- Returns:
- the priced cart
-
priceCartItems
public void priceCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Specified by:
priceCartItemsin interfaceCartPricingService
-
calculateTotals
public void calculateTotals(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartPricingServiceCalculate the totals for the cart. This assumes pricing such as item amount, adjustments, and taxes have been determined already.- Specified by:
calculateTotalsin interfaceCartPricingService- Parameters:
cart- The cart to calculate totals for.
-
determineTaxCalculationStrategy
protected String determineTaxCalculationStrategy(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to determine theTaxCalculationStrategybased on the givenCart.By default,
DefaultTaxCalculationStrategies.ACTUALis used when taxes can be calculated, otherwiseDefaultTaxCalculationStrategies.SKIPis used.For different requirements for actual vs. estimated taxes, customization should be added here.
- Parameters:
cart- theCartto determine theTaxCalculationStrategyforcontextInfo- additional sandbox and multitenant info- Returns:
- the
TaxCalculationStrategyfor the givenCart - See Also:
-
applyTaxes
protected void applyTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimate, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Applies taxes for the givenCart.- Parameters:
cart- theCartto calculate the taxes forestimate- whether or not to apply estimated taxes, typically used when there's only a partial address associated with the cart.contextInfo- additional sandbox and multitenant info
-
determineTaxableAmounts
protected void determineTaxableAmounts(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Determines and setsFulfillmentItem.getMerchandiseTaxableAmount()andFulfillmentGroup.getFulfillmentTaxableAmount(). This will by default prorate theCartPricing.getAdjustmentsTotal()acrossFulfillmentItem.getMerchandiseTotalAmount().By default, a tax item is created for each group as a whole when calculating fulfillment tax, therefore no proration is necessary. To also prorate fulfillment-group adjustments across its items, extend this to add that proration.
- Parameters:
cart- Cart with items to be taxed
-
prorateOrderAdjustments
@Deprecated(since="1.7.2", forRemoval=true) protected void prorateOrderAdjustments(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.FulfillmentItem> fulfillmentItems, @NonNull @NonNull javax.money.MonetaryAmount adjustmentsTotal) Deprecated, for removal: This API element is subject to removal in a future version.since 1.7.2, adjustment prorations are now done in OfferServicesDistributes the order-level adjustments to all of the items for tax purposes.- Parameters:
fulfillmentItems-FulfillmentItemsonto which to distribute theadjustmentsTotaladjustmentsTotal- Total amount of the order-level adjustments to be distributed usually fromCartPricing.getAdjustmentsTotal().
-
updateTaxableAmounts
protected <T extends com.broadleafcommerce.cart.client.domain.CartItem> void updateTaxableAmounts(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.FulfillmentGroup> fulfillmentGroups, @NonNull @NonNull Collection<T> cartItems) Updates the taxable amount fields onFulfillmentItem. This should run after applying offers to ensure discounts are properly accounted for.By default, fulfillment taxable amounts are calculated at the fulfillment group level, and not the fulfillment item level. To calculate fulfillment taxes at the item level, extend this to calculate fulfillment taxable amounts for each fulfillment item.
- Parameters:
fulfillmentGroups- All of the fulfillment groups in a cart to be taxed.cartItems- All of the cart items from a cart to checkCartItem.isTaxable()
-
calculateItemSubtotal
protected boolean calculateItemSubtotal(com.broadleafcommerce.cart.client.domain.Cart cart, boolean shouldPriceCart, com.broadleafcommerce.cart.client.domain.CartItem item, javax.money.CurrencyUnit expectedCurrency) -
calculateItemSubtotal
@Deprecated protected boolean calculateItemSubtotal(boolean shouldPriceCart, com.broadleafcommerce.cart.client.domain.CartItem item, javax.money.CurrencyUnit expectedCurrency) Deprecated. -
updateCartItemPricing
protected boolean updateCartItemPricing(com.broadleafcommerce.cart.client.domain.Cart cart, Locale locale, javax.money.CurrencyUnit expectedCurrency, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateCartItemPricing
@Deprecated protected boolean updateCartItemPricing(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, Locale locale, javax.money.CurrencyUnit expectedCurrency, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
buildPriceCartRequest
protected PriceCartRequest buildPriceCartRequest(com.broadleafcommerce.cart.client.domain.Cart cart) -
setDefaultsForPriceCartRequest
protected void setDefaultsForPriceCartRequest(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest) -
getCurrencyFromCart
protected javax.money.CurrencyUnit getCurrencyFromCart(com.broadleafcommerce.cart.client.domain.Cart cart) -
prepareCartForPricing
protected void prepareCartForPricing(com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
clearCartPrices
protected void clearCartPrices(com.broadleafcommerce.cart.client.domain.Cart cart) -
clearFulfillmentPricing
protected void clearFulfillmentPricing(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) -
clearItemPricing
protected void clearItemPricing(com.broadleafcommerce.cart.client.domain.CartItem ci) -
zeroIfNull
protected final javax.money.MonetaryAmount zeroIfNull(@Nullable javax.money.MonetaryAmount amount, @Nullable javax.money.CurrencyUnit currency) Defaults theamountto zero if null.- Parameters:
amount- TheMonetaryAmountto default to zerocurrency- Theamount'sCurrencyUnit- Returns:
- The
amountor zero if null.
-
buildCatalogItemRequests
protected Collection<CatalogItemRequest> buildCatalogItemRequests(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
catalogItemRequestAlreadyExist
protected boolean catalogItemRequestAlreadyExist(@NonNull @NonNull Set<CatalogItemRequest> catalogItemRequests, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to prevent duplicateCatalogItemRequestsfrom being built based on theCartItem.By default, we filter on the product ID.
- Parameters:
catalogItemRequests- the list of requests to pass to theCatalogProvidercartItem- theCartItemto build theCatalogItemRequestcontextInfo- context information around sandbox and multitenant state- Returns:
- true if building a new
CatalogItemRequestwould be a duplicate of an existing request incatalogItemRequests
-
buildCatalogItemRequest
protected CatalogItemRequest buildCatalogItemRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to create theCatalogItemRequestand populate any additional attributes that should be passed to theCatalogProviderwhen fetching the catalog representation for the cart item.- Parameters:
cartItem- theCartItemto build theCatalogItemRequestcontextInfo- context information around sandbox and multitenant state- Returns:
- the populated
CatalogItemRequestfor theCartItem
-
getCatalogItemKeyFromCartItem
protected String getCatalogItemKeyFromCartItem(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Hook point to determine what the catalog item is keyed on from theCartItem.By default, this is set to the product ID.
- Parameters:
cartItem- the cart item to identify a catalog item key from- Returns:
- the key for the catalog item
-
getPriceContext
@Nullable protected com.broadleafcommerce.pricing.client.domain.context.PriceContext getPriceContext(@Nullable Locale locale, @Nullable javax.money.CurrencyUnit currency) -
getCartItemPricingUtils
-
getCartProvider
-
getPricingProvider
-
getOfferProvider
-
getCatalogProvider
-
getCartItemConfigurationService
-
getTaxService
-
getFulfillmentPricingService
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getCartTotalsCalculator
-
getRoundingHelper
-
getCartOperationServiceProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getMessageSource
protected org.springframework.context.MessageSource getMessageSource() -
getCartOpsServiceOfferUtils
-
setCartOpsServiceOfferUtils
@Autowired public void setCartOpsServiceOfferUtils(CartOperationServiceOfferUtils cartOpsServiceOfferUtils) -
setStaleCartItemsService
-
getStaleCartItemsService
-
setBroadleafProductService
@Autowired public void setBroadleafProductService(BroadleafProductService<Product> broadleafProductService) -
getBroadleafProductService
-