Class CartItemPricingUtils
java.lang.Object
com.broadleafcommerce.cartoperation.service.pricing.CartItemPricingUtils
Utility to aid in pricing
CartItems.- Author:
- Chad Harchar (charchar), Nathan Moore (nathandmoore)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classLightweight DTO with pricing information for aCartItembased on the relatedCatalogItemandVariantit represents. -
Constructor Summary
ConstructorsConstructorDescriptionCartItemPricingUtils(CartItemPriceableTargetUtils cartItemPriceableTargetUtils, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattachBundleItemProratedPrices(@NonNull com.broadleafcommerce.cart.client.domain.CartItem bundleCartItem, Map<String, javax.money.MonetaryAmount> roundedDependentItemProratedPrice, javax.money.CurrencyUnit expectedCurrency) protected voidattachBundleItemProratedPrices(List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems, Map<String, javax.money.MonetaryAmount> roundedDependentItemProratedPrice, javax.money.CurrencyUnit expectedCurrency) Deprecated.protected voidcalculateAndAttachBundleItemProratedPrices(@NonNull com.broadleafcommerce.cart.client.domain.CartItem bundleCartItem, @NonNull javax.money.CurrencyUnit expectedCurrency) voidcalculateAndAttachBundleItemProratedPrices(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Calculates the prorated prices for the dependent cart items based on the bundle item total price.calculateBundleDependentItemPriceProration(com.broadleafcommerce.cart.client.domain.CartItem bundleCartItem, javax.money.CurrencyUnit expectedCurrency, javax.money.MonetaryAmount bundleTotalAmount) protected javax.money.MonetaryAmountcalculateBundleDependentItemProratedPrice(com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem, javax.money.MonetaryAmount bundleSubtotal, javax.money.MonetaryAmount dependentItemsTotal, javax.money.CurrencyUnit expectedCurrency) protected <T extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<T>checkForPriceInfoForVariantFromPriceList(List<T> candidatePriceInfos, com.broadleafcommerce.cart.client.domain.CartItem cartItem) com.broadleafcommerce.pricing.client.domain.PriceInfocleanPriceInfo(@NonNull com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) ExcludePriceableTargetinformation from thePriceInfoas it's unnecessary to calculate pricing.protected com.broadleafcommerce.order.common.domain.AdjustmentcreateBundleDependentItemAdjustment(javax.money.MonetaryAmount adjustmentAmount) Deprecated.protected com.broadleafcommerce.order.common.domain.AdjustmentcreateBundleDependentItemAdjustment(javax.money.MonetaryAmount adjustmentAmount, Integer bundleItemQuantity) <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<P>determineMatchingPriceInfo(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull Collection<P> priceInfos) Deprecated, for removal: This API element is subject to removal in a future version.since 2.1.0, in favor ofdetermineMatchingPriceInfo(PriceContext, CartItem, Collection, String).<P extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<P>determineMatchingPriceInfo(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull Collection<P> priceInfos, String variantId) Deprecated, for removal: This API element is subject to removal in a future version.since 2.1.0, in favor ofdetermineMatchingPriceInfo(PriceContext, CartItem, Collection, String).<P extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<P>determineMatchingPriceInfo(@NonNull com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull Collection<P> priceInfos, String variantId) Determines the matchingPriceInfofor aCartItemfrom among the givenpriceInfos.protected <T extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
List<T>filterPriceInfosForCurrency(List<T> priceInfos, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext) protected CartItemPriceableTargetUtilsprotected com.broadleafcommerce.common.extension.TypeFactoryprotected com.broadleafcommerce.pricing.client.domain.PriceableTargetgetItemChoiceTarget(com.broadleafcommerce.cart.client.domain.DependentItemDetails details, String vendorRef, int quantity) Builds aPriceableTargetfor the parentItemChoiceof a dependentCartItemrepresenting aSpecificItemChoice.protected <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<P>getItemPriceInfo(com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem) protected com.fasterxml.jackson.databind.ObjectMappergetPartitionTargetKey(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Given a CartItem, create a key that will be used to denote a single PriceableTarget for the count of all same CartItem instances.Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget>getPriceableTargets(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, Map<String, Integer> totalQuantityForTargetId) Builds thePriceableTargetsfor the givenCartItemand itsdependents.Optional<com.broadleafcommerce.pricing.client.domain.PriceInfo>getPriceInfo(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Gets thePriceInfofrom the givenCartItem.protected <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<P>getPriceInfoForDependentItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull Collection<P> priceInfos, String variantId) Determines the matchingPriceInfofor a dependentCartItem.protected <T extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<T>getPriceInfoForVariant(com.broadleafcommerce.cart.client.domain.CartItem cartItem, List<T> candidatePriceInfos, com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext) getPriceInfos(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) getPricingKey(@NonNull CatalogItem catalogItem, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Returns the catalogItem price key, if specified, otherwise retrieves it from the cart item or generates a new one.protected ObjectgetProductType(com.broadleafcommerce.cart.client.domain.CartItem cartItem) protected CartPricingRoundingHelperprotected com.broadleafcommerce.pricing.client.domain.PriceableTargetgetSpecificChoiceTarget(@NonNull com.broadleafcommerce.cart.client.domain.DependentItemDetails details, String vendorRef, int quantity) Builds aPriceableTargetfor a dependentCartItem.protected com.broadleafcommerce.pricing.client.domain.PriceableTargetgetSpecificChoiceVariantOverrideTarget(@NonNull com.broadleafcommerce.cart.client.domain.SpecificItemChoiceVariantPricingOverride override, String vendorRef, int quantity) protected List<com.broadleafcommerce.pricing.client.domain.PriceableTarget>getTargetsForDependentItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull Map<String, Integer> totalQuantityForTargetId, String parentCartItemVariantId) Builds the list ofPriceableTargetsfor the given dependentCartItem.protected booleanhasAdjustmentPriceData(com.broadleafcommerce.pricing.client.domain.PriceInfo info) Returns true if the record contains an adjustment with a price data id.protected <T extends com.broadleafcommerce.pricing.client.domain.PriceInfo>
Optional<T>hasPriceInfoFromPriceList(List<T> candidatePriceInfos) protected booleanisBasePrice(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) protected booleanisBaseSalePrice(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) booleanisItemPriceLimitedByQuantity(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Checks if theCartItemhas a price with limited quantity available such as for a flash sale.protected booleanisPricingKeyTarget(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) protected booleanisTargetingVariantSku(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo, String sku) protected booleanisValidPriceSourceForVariantSku(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) protected booleanitemIsTargeted(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) protected booleanitemIsTargeted(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo, com.broadleafcommerce.cart.client.domain.AdditionalItemPricing itemPricing) protected booleanitemIsTargeted(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo, com.broadleafcommerce.cart.client.domain.DependentItemDetails details) populatePricingInfoForItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull CatalogItem catalogItem, Variant variant) Determines and populates thePriceInfosand pricing key for theCartItembased on the relatedCatalogItemand optionally theVariant.voidremoveIsItemPriceLimitedByQuantityFlag(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Removes theCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYattribute from the givenCartItem.getInternalAttributes().voidsetIsItemPriceLimitedByQuantityFlag(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Sets theCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYattribute to true for the givenCartItem.getInternalAttributes().voidsetRoundingHelper(CartPricingRoundingHelper roundingHelper)
-
Constructor Details
-
CartItemPricingUtils
public CartItemPricingUtils(CartItemPriceableTargetUtils cartItemPriceableTargetUtils, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory factory)
-
-
Method Details
-
getPriceableTargets
public Set<com.broadleafcommerce.pricing.client.domain.PriceableTarget> getPriceableTargets(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, Map<String, Integer> totalQuantityForTargetId) Builds thePriceableTargetsfor the givenCartItemand itsdependents.- Parameters:
cartItem-CartItemfor which to buildPriceableTargetstotalQuantityForTargetId- A map of the SKU or pricing key of an underlying item from a cart item to the total quantity of that item across all cart items.- Returns:
- the
PriceableTargetsforcartItemand itsdependents.
-
determineMatchingPriceInfo
@Deprecated(since="2.1.0", forRemoval=true) public <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo> Optional<P> determineMatchingPriceInfo(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Collection<P> priceInfos) Deprecated, for removal: This API element is subject to removal in a future version.since 2.1.0, in favor ofdetermineMatchingPriceInfo(PriceContext, CartItem, Collection, String). -
determineMatchingPriceInfo
@Deprecated(since="2.1.0", forRemoval=true) public <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo> Optional<P> determineMatchingPriceInfo(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Collection<P> priceInfos, @Nullable String variantId) Deprecated, for removal: This API element is subject to removal in a future version.since 2.1.0, in favor ofdetermineMatchingPriceInfo(PriceContext, CartItem, Collection, String). -
determineMatchingPriceInfo
public <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo> Optional<P> determineMatchingPriceInfo(@NonNull @NonNull com.broadleafcommerce.pricing.client.domain.context.PriceContext priceContext, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Collection<P> priceInfos, @Nullable String variantId) Determines the matchingPriceInfofor aCartItemfrom among the givenpriceInfos. When given a variantId, this will prioritize aPriceInfofor a variant override pricing if it exists.- Type Parameters:
P- The type of thePriceInfoin the collection- Parameters:
priceContext- ThePriceContextcartItem- TheCartItemfor which to determine aPriceInfopriceInfos- Collection ofPriceInfosfrom which to choose a matchvariantId- The variant ID of a parentCartItem, if it exists- Returns:
- The matching
PriceInfoforcartItem.
-
populatePricingInfoForItem
public CartItemPricingUtils.PriceInfoResponse populatePricingInfoForItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull CatalogItem catalogItem, @Nullable Variant variant) Determines and populates thePriceInfosand pricing key for theCartItembased on the relatedCatalogItemand optionally theVariant. This specifically determines the values forCartItemAttributeConstants.Internal.SKU_PRICE_INFOSandCartItemAttributeConstants.Internal.PRICING_KEY_PRICE_INFOS- Parameters:
cartItem- The cart item to get price info forcatalogItem- The catalog item represented by the cart itemvariant- Optional variant of the catalog item that is represented by the cart item- Returns:
- The
PriceInfosand pricing key for theCartItem - Since:
- Cart Operations 2.3.0, Release Train 2.3.0
-
cleanPriceInfo
public com.broadleafcommerce.pricing.client.domain.PriceInfo cleanPriceInfo(@NonNull @NonNull com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) ExcludePriceableTargetinformation from thePriceInfoas it's unnecessary to calculate pricing.- Parameters:
priceInfo- The price info to clean up for addition to CartItem attributes- Returns:
- The price info with target information excluded
- Since:
- Cart Operations 2.3.0, Release Train 2.3.0
-
getPricingKey
public String getPricingKey(@NonNull @NonNull CatalogItem catalogItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Returns the catalogItem price 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 catalogItem to get the pricing key fromcartItem- the cart item to get the pricing key from- Returns:
- the pricing key
- Since:
- Cart Operations 2.3.0, Release Train 2.3.0
-
getPriceInfoForVariant
-
hasAdjustmentPriceData
protected boolean hasAdjustmentPriceData(com.broadleafcommerce.pricing.client.domain.PriceInfo info) Returns true if the record contains an adjustment with a price data id.- Parameters:
info-- Returns:
-
isPricingKeyTarget
protected boolean isPricingKeyTarget(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) -
checkForPriceInfoForVariantFromPriceList
-
isValidPriceSourceForVariantSku
protected boolean isValidPriceSourceForVariantSku(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) -
isTargetingVariantSku
protected boolean isTargetingVariantSku(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo, String sku) -
filterPriceInfosForCurrency
-
hasPriceInfoFromPriceList
-
isBasePrice
protected boolean isBasePrice(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) -
isBaseSalePrice
protected boolean isBaseSalePrice(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) -
calculateAndAttachBundleItemProratedPrices
public void calculateAndAttachBundleItemProratedPrices(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Calculates the prorated prices for the dependent cart items based on the bundle item total price. For example, item 1: $6 and item 2: $4, then item 1 takes 60% of the bundle price and item 2 takes 40%. It creates an item adjustment that represents the normal merchandise total minus the prorated merchandise total. For example: unitPrice = $5 | quantity = 2 | proratedMerchTotal = $8 >> item adjustment of $2 (ie = ($5 * 2) - $8) This method also rounds the prorated prices usingCartPricingRoundingHelper.roundListOfMonetaryAmounts(java.util.Map, javax.money.MonetaryAmount, javax.money.CurrencyUnit)to the bundle total to add the remainder unit amounts. This prevents the situation e.g when the bundle total is $40 but the sum of the prorated item prices is $39.99.- Parameters:
cart- the cart that contains the bundle products to calculate the prorated price
-
getPriceInfo
public Optional<com.broadleafcommerce.pricing.client.domain.PriceInfo> getPriceInfo(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Gets thePriceInfofrom the givenCartItem.- Parameters:
cartItem- theCartItemto get thePriceInfofrom.- Returns:
- the
PriceInfofrom the givenCartItem
-
isItemPriceLimitedByQuantity
public boolean isItemPriceLimitedByQuantity(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Checks if theCartItemhas a price with limited quantity available such as for a flash sale. By default, this checksCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYin the item'sinternal attributes.- Parameters:
cartItem- TheCartItemto check.- Returns:
- The result of the check.
-
setIsItemPriceLimitedByQuantityFlag
public void setIsItemPriceLimitedByQuantityFlag(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Sets theCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYattribute to true for the givenCartItem.getInternalAttributes().- Parameters:
cartItem-CartItemto set theCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYflag for
-
removeIsItemPriceLimitedByQuantityFlag
public void removeIsItemPriceLimitedByQuantityFlag(com.broadleafcommerce.cart.client.domain.CartItem cartItem) Removes theCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYattribute from the givenCartItem.getInternalAttributes().- Parameters:
cartItem-CartItemto remove theCartItemAttributeConstants.Internal.IS_PRICE_LIMITED_BY_QUANTITYfrom
-
getProductType
@Nullable protected Object getProductType(com.broadleafcommerce.cart.client.domain.CartItem cartItem) -
calculateAndAttachBundleItemProratedPrices
protected void calculateAndAttachBundleItemProratedPrices(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem bundleCartItem, @NonNull @NonNull javax.money.CurrencyUnit expectedCurrency) -
calculateBundleDependentItemPriceProration
-
attachBundleItemProratedPrices
-
createBundleDependentItemAdjustment
protected com.broadleafcommerce.order.common.domain.Adjustment createBundleDependentItemAdjustment(javax.money.MonetaryAmount adjustmentAmount, Integer bundleItemQuantity) -
attachBundleItemProratedPrices
@Deprecated(since="1.7.2") protected void attachBundleItemProratedPrices(List<com.broadleafcommerce.cart.client.domain.CartItem> dependentCartItems, Map<String, javax.money.MonetaryAmount> roundedDependentItemProratedPrice, javax.money.CurrencyUnit expectedCurrency) Deprecated. -
createBundleDependentItemAdjustment
@Deprecated(since="1.7.2") protected com.broadleafcommerce.order.common.domain.Adjustment createBundleDependentItemAdjustment(javax.money.MonetaryAmount adjustmentAmount) Deprecated. -
getItemPriceInfo
protected <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo> Optional<P> getItemPriceInfo(com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem) -
getPriceInfos
-
calculateBundleDependentItemProratedPrice
protected javax.money.MonetaryAmount calculateBundleDependentItemProratedPrice(com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem, javax.money.MonetaryAmount bundleSubtotal, javax.money.MonetaryAmount dependentItemsTotal, javax.money.CurrencyUnit expectedCurrency) -
getPriceInfoForDependentItem
protected <P extends com.broadleafcommerce.pricing.client.domain.PriceInfo> Optional<P> getPriceInfoForDependentItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Collection<P> priceInfos, @Nullable String variantId) Determines the matchingPriceInfofor a dependentCartItem.- It checks based on its
DependentItemDetails.getVariantPricing()for an override price that matches the parentCartItem's Variantif present. - Then, it checks its
AdditionalItemPricingfrom among the givenpriceInfos. - Finally, it checks based on its parent
ItemChoice'spricing in theDependentItemDetails.
- Type Parameters:
P- The type of thePriceInfoin the collection- Parameters:
cartItem- The dependentCartItemfor which to determine aPriceInfopriceInfos- Collection ofPriceInfosfrom which to choose a matchvariantId- The variant ID of a parentCartItem, if it exists- Returns:
- The matching
PriceInfoforcartItem.
- It checks based on its
-
getPartitionTargetKey
public String getPartitionTargetKey(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Given a CartItem, create a key that will be used to denote a single PriceableTarget for the count of all same CartItem instances. This is generally a simple pricingKey or sku determination for the comparison. However, in some cases, it may be helpful to embellish the key further to express differentiating pricing considerations - even for the same sku in the same cart. For example, this can arise in combined cart scenarios where the same CartItem may exist more than once in the cart with different pricing per line item - depending on the context in which the CartItem was added.- Parameters:
cartItem- The CartItem instance from which the partition target key is derived- Returns:
- The partition target key
- See Also:
-
getTargetsForDependentItem
protected List<com.broadleafcommerce.pricing.client.domain.PriceableTarget> getTargetsForDependentItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Map<String, Integer> totalQuantityForTargetId, @Nullable String parentCartItemVariantId) Builds the list ofPriceableTargetsfor the given dependentCartItem.- Parameters:
cartItem-CartItemfor which to buildPriceableTargetstotalQuantityForTargetId- A map of the SKU or pricing key of an underlying item from a cart item to the total quantity of that item across all cart items.parentCartItemVariantId- The ID of theVariantof the parentCartItemifCartItem.getVariantId()is present. This can affect the pricing of the dependent item.- Returns:
- The
PriceableTargetsforcartItem
-
getItemChoiceTarget
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget getItemChoiceTarget(com.broadleafcommerce.cart.client.domain.DependentItemDetails details, String vendorRef, int quantity) Builds aPriceableTargetfor the parentItemChoiceof a dependentCartItemrepresenting aSpecificItemChoice.- Parameters:
details- TheDependentItemDetailsof the dependentCartItemvendorRef- ThevendorRefquantity- The quantity of the dependentCartItem- Returns:
- A
PriceableTargetfor the parentItemChoiceof a dependentCartItemrepresenting aSpecificItemChoice.
-
getSpecificChoiceTarget
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget getSpecificChoiceTarget(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.DependentItemDetails details, @Nullable String vendorRef, int quantity) Builds aPriceableTargetfor a dependentCartItem.- Parameters:
details- TheDependentItemDetailsof the dependentCartItemvendorRef- ThevendorRefquantity- The quantity of the dependentCartItem- Returns:
- A
PriceableTargetfor a dependentCartItem.
-
getSpecificChoiceVariantOverrideTarget
protected com.broadleafcommerce.pricing.client.domain.PriceableTarget getSpecificChoiceVariantOverrideTarget(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.SpecificItemChoiceVariantPricingOverride override, @Nullable String vendorRef, int quantity) -
itemIsTargeted
protected boolean itemIsTargeted(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) -
itemIsTargeted
protected boolean itemIsTargeted(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo, com.broadleafcommerce.cart.client.domain.AdditionalItemPricing itemPricing) -
itemIsTargeted
protected boolean itemIsTargeted(com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo, com.broadleafcommerce.cart.client.domain.DependentItemDetails details) -
getCartItemPriceableTargetUtils
-
getMapper
protected com.fasterxml.jackson.databind.ObjectMapper getMapper() -
getFactory
protected com.broadleafcommerce.common.extension.TypeFactory getFactory() -
getRoundingHelper
-
setRoundingHelper
-
attachBundleItemProratedPrices(CartItem, Map, CurrencyUnit)