Class CartItem
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,com.broadleafcommerce.money.CurrencyConsumer
,Serializable
,javax.money.CurrencySupplier
Cart
. Contains information related to pricing, quantity, and external object
references.- Author:
- Chad Harchar (charchar)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Deprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
void
Clears all configuration error fields of contents.boolean
javax.money.MonetaryAmount
The total adjustment price for alladjustments
of aCartItem
.javax.money.MonetaryAmount
Attribute choices for this item driven by product options, where each key is theattributeName
from an attribute choice.Map of configuration errors for related to this item'sattributeChoices
that are derived from ProductOptions where the key is the attribute name.Miscellaneous attributes for this item.The id to the corresponding data driven enum for this item's product's brand.getCart()
The owning cart of this item.The Cart's version.The ids to the corresponding categories for this item's product.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.javax.money.CurrencyUnit
Map of configuration errors for related to this item'sdependentCartItems
where the key is the item's identifier such as ProductOption choiceKey.If thisCartItem
is a dependent cart item, this contains additional details about the dependentCartItem's
dependency on its parent.List of global configuration errors.getId()
The context ID of the cart.The image asset for this item, usually sourced from the product.Miscellaneous internal attributes for this item.List<com.broadleafcommerce.order.common.domain.Adjustment>
Adjustments to item pricing that should be applied togetSubtotal()
.Defines the merchandising context of the item to signify where it is added from.The id to the corresponding data driven enum for this item's product's merchandising type.getName()
The name of this item.List<com.broadleafcommerce.order.common.domain.OverrideDetail>
List of details about any price overrides which have been performed on this item.The id of the price list used to get the pricing for thisCartItem
.System-wide unique identifier to configure specific pricing for this cart item.For dependent cart items, this strategy is used to indicate how the price should be incorporated into the overall cart subtotal - i.e.The id to the corresponding product for this item.The list of simple labels used to categorize the corresponding product for this item.List<com.broadleafcommerce.order.common.domain.ProratedOfferAdjustment>
Prorated adjustments for this item from order-level offers.The number of this item in theCart
.javax.money.MonetaryAmount
com.broadleafcommerce.order.common.domain.RecurringPriceDetail
This is the recurring price if any from the same source as theunitPrice
.OverridesunitPriceType
for therecurringPrice
in cases where they must diverge.javax.money.MonetaryAmount
javax.money.MonetaryAmount
javax.money.MonetaryAmount
getSku()
Represents a SKU code, similar to productId or variantId, except this is a unified, unique concept across both products and variants.javax.money.MonetaryAmount
The subtotal price of thisCartItem
.javax.money.MonetaryAmount
The id to the corresponding data driven enum for this item's product's target demographic.The length of the terms, e.g., if this is 36 andtermDurationType
is MONTHS, then therecurringPrice
should be charged for 36 months.The term duration type, e.g.javax.money.MonetaryAmount
getTotal()
The total price of thisCartItem
.javax.money.MonetaryAmount
getType()
The type of this cart item.javax.money.MonetaryAmount
The individual unit price for aCartItem
.The type of the unit price for aCartItem
.javax.money.MonetaryAmount
javax.money.MonetaryAmount
getUri()
The navigable uri of the corresponding catalog entry for this cart item.com.broadleafcommerce.order.common.domain.UsagePriceDetail
This is the usage price if any from the same source as theunitPrice
.The id to the corresponding variant for this item.A reference to the corresponding vendor for this item.boolean
boolean
int
hashCode()
boolean
Whether or not this item can be applied to any offers or promotions.boolean
Whether the price of thisCartItem
was specifically overridden, whether from a CSR or an automatic process.boolean
isPriced()
Flag to indicate whether this item has been priced.boolean
Whether this item is taxable.void
setAdjustmentsTotal
(javax.money.MonetaryAmount adjustmentsTotal) The total adjustment price for alladjustments
of aCartItem
.void
setAttributeChoices
(Map<String, com.broadleafcommerce.order.common.domain.AttributeChoiceValue> attributeChoices) Attribute choices for this item driven by product options, where each key is theattributeName
from an attribute choice.void
setAttributeConfigErrors
(Map<String, List<ConfigError>> attributeConfigErrors) Map of configuration errors for related to this item'sattributeChoices
that are derived from ProductOptions where the key is the attribute name.void
setAttributes
(Map<String, Object> attributes) Miscellaneous attributes for this item.void
setBrandId
(String brandId) The id to the corresponding data driven enum for this item's product's brand.void
The owning cart of this item.void
setCartVersion
(Integer cartVersion) The Cart's version.void
setCategoryIds
(Set<String> categoryIds) The ids to the corresponding categories for this item's product.void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setCurrency
(javax.money.CurrencyUnit currency) void
setDependentCartItems
(List<CartItem> dependentCartItems) void
setDependentItemConfigErrors
(Map<String, List<ConfigError>> dependentItemConfigErrors) Map of configuration errors for related to this item'sdependentCartItems
where the key is the item's identifier such as ProductOption choiceKey.void
setDependentItemDetails
(DependentItemDetails dependentItemDetails) If thisCartItem
is a dependent cart item, this contains additional details about the dependentCartItem's
dependency on its parent.void
setDiscountable
(boolean discountable) Whether or not this item can be applied to any offers or promotions.void
setGlobalConfigErrors
(List<ConfigError> globalConfigErrors) List of global configuration errors.void
The context ID of the cart.void
setImageAsset
(ImageAssetRef imageAsset) The image asset for this item, usually sourced from the product.void
setInternalAttributes
(Map<String, Object> internalAttributes) Miscellaneous internal attributes for this item.void
setItemAdjustments
(List<com.broadleafcommerce.order.common.domain.Adjustment> itemAdjustments) Adjustments to item pricing that should be applied togetSubtotal()
.void
setMerchandisingContext
(String merchandisingContext) Defines the merchandising context of the item to signify where it is added from.void
setMerchandisingTypeId
(String merchandisingTypeId) The id to the corresponding data driven enum for this item's product's merchandising type.void
The name of this item.void
setOverrideDetails
(List<com.broadleafcommerce.order.common.domain.OverrideDetail> overrideDetails) List of details about any price overrides which have been performed on this item.void
setOverridePriceFlag
(boolean overridePriceFlag) Whether the price of thisCartItem
was specifically overridden, whether from a CSR or an automatic process.void
setPriced
(boolean isPriced) Flag to indicate whether this item has been priced.void
setPriceListId
(String priceListId) The id of the price list used to get the pricing for thisCartItem
.void
setPricingKey
(String pricingKey) System-wide unique identifier to configure specific pricing for this cart item.void
setPricingStrategy
(String pricingStrategy) For dependent cart items, this strategy is used to indicate how the price should be incorporated into the overall cart subtotal - i.e.void
setProductId
(String productId) The id to the corresponding product for this item.void
setProductTags
(List<String> productTags) The list of simple labels used to categorize the corresponding product for this item.void
setProratedOrderOfferAdjustments
(List<com.broadleafcommerce.order.common.domain.ProratedOfferAdjustment> proratedOrderOfferAdjustments) Prorated adjustments for this item from order-level offers.void
setQuantity
(Integer quantity) The number of this item in theCart
.void
setRecurringPrice
(com.broadleafcommerce.order.common.domain.RecurringPriceDetail recurringPrice) This is the recurring price if any from the same source as theunitPrice
.void
setRecurringPriceTypeOverride
(String recurringPriceTypeOverride) OverridesunitPriceType
for therecurringPrice
in cases where they must diverge.void
Represents a SKU code, similar to productId or variantId, except this is a unified, unique concept across both products and variants.void
setSubtotal
(javax.money.MonetaryAmount subtotal) The subtotal price of thisCartItem
.void
setTargetDemographicId
(String targetDemographicId) The id to the corresponding data driven enum for this item's product's target demographic.void
setTaxable
(boolean taxable) Whether this item is taxable.void
setTermDurationLength
(Integer termDurationLength) The length of the terms, e.g., if this is 36 andtermDurationType
is MONTHS, then therecurringPrice
should be charged for 36 months.void
setTermDurationType
(String termDurationType) The term duration type, e.g.void
setTotal
(javax.money.MonetaryAmount total) The total price of thisCartItem
.void
The type of this cart item.void
setUnitPrice
(javax.money.MonetaryAmount unitPrice) The individual unit price for aCartItem
.void
setUnitPriceType
(String unitPriceType) The type of the unit price for aCartItem
.void
The navigable uri of the corresponding catalog entry for this cart item.void
setUsagePrice
(com.broadleafcommerce.order.common.domain.UsagePriceDetail usagePrice) This is the usage price if any from the same source as theunitPrice
.void
setVariantId
(String variantId) The id to the corresponding variant for this item.void
setVendorRef
(String vendorRef) A reference to the corresponding vendor for this item.toString()
-
Constructor Details
-
CartItem
public CartItem()
-
-
Method Details
-
hasConfigErrors
public boolean hasConfigErrors()- Returns:
- Whether any of the configuration error fields have contents.
-
clearConfigErrors
public void clearConfigErrors()Clears all configuration error fields of contents. -
getRecurringPeriodTypeWithDependentItems
-
getUnitPriceWithDependentItems
public javax.money.MonetaryAmount getUnitPriceWithDependentItems() -
getRecurringPriceWithDependentItems
public javax.money.MonetaryAmount getRecurringPriceWithDependentItems()- Since:
- CartClient 2.0.4
-
getSubtotalWithDependentItems
public javax.money.MonetaryAmount getSubtotalWithDependentItems() -
getRecurringSubtotalWithDependentItems
public javax.money.MonetaryAmount getRecurringSubtotalWithDependentItems()- Since:
- CartClient 2.0.4
-
getAdjustmentsTotalWithDependentItems
public javax.money.MonetaryAmount getAdjustmentsTotalWithDependentItems() -
getRecurringAdjustmentsTotalWithDependentItems
public javax.money.MonetaryAmount getRecurringAdjustmentsTotalWithDependentItems()- Since:
- CartClient 2.0.4
-
getTotalWithDependentItems
public javax.money.MonetaryAmount getTotalWithDependentItems() -
getRecurringTotalWithDependentItems
public javax.money.MonetaryAmount getRecurringTotalWithDependentItems()- Since:
- CartClient 2.0.4
-
getUnitPriceWithAdjustments
public javax.money.MonetaryAmount getUnitPriceWithAdjustments() -
hasFreeTrial
public boolean hasFreeTrial() -
getCurrency
public javax.money.CurrencyUnit getCurrency()- Specified by:
getCurrency
in interfacejavax.money.CurrencySupplier
-
getId
The context ID of the cart.- Returns:
- the context ID of the cart
-
getName
The name of this item. Typically derived from the product or sku name.- Returns:
- The name of this item. Typically derived from the product or sku name.
-
getUri
The navigable uri of the corresponding catalog entry for this cart item.- Returns:
- The navigable uri of the corresponding catalog entry for this cart item.
-
getQuantity
The number of this item in theCart
.- Returns:
- The number of this item in the
Cart
.
-
getDependentCartItems
-
getDependentItemDetails
If thisCartItem
is a dependent cart item, this contains additional details about the dependentCartItem's
dependency on its parent.This should always be populated for items within
getDependentCartItems()
, and should never be populated for non-dependent items.- Returns:
- details about the dependent
CartItem's
dependency on its parent
-
isOverridePriceFlag
public boolean isOverridePriceFlag()Whether the price of thisCartItem
was specifically overridden, whether from a CSR or an automatic process.- Returns:
- Whether the price of this
CartItem
was specifically overridden, whether from a CSR or an automatic process.
-
getPriceListId
The id of the price list used to get the pricing for thisCartItem
.- Returns:
- The id of the price list used to get the pricing for this
CartItem
.
-
getUnitPrice
public javax.money.MonetaryAmount getUnitPrice()The individual unit price for aCartItem
.- Returns:
- The individual unit price for a
CartItem
.
-
getUnitPriceType
The type of the unit price for aCartItem
. Typically "salePrice", "standardPrice", or "basePrice".- Returns:
- The type of the unit price for a
CartItem
.
-
getRecurringPriceTypeOverride
OverridesunitPriceType
for therecurringPrice
in cases where they must diverge. Usually only in Offer use cases where an offer cannot apply to a sale recurring price but can apply to the standard recurring price and we need to leave the upfront price as the sale priceāor vice versa.- Since:
- Cart Client 2.0.4
-
getRecurringPrice
public com.broadleafcommerce.order.common.domain.RecurringPriceDetail getRecurringPrice()This is the recurring price if any from the same source as theunitPrice
. The recurring price is used for subscriptions and is not expected to be charged at checkout typically.- Returns:
- This is the recurring price if any from the same source as the
unitPrice
. - Since:
- Cart Client 2.0.4
- See Also:
-
termDurationType
termDurationLength
-
getUsagePrice
public com.broadleafcommerce.order.common.domain.UsagePriceDetail getUsagePrice()This is the usage price if any from the same source as theunitPrice
. The usage price represents a charge when an item is used, e.g., when using minutes above the base allowance. This is generally just information from a Cart's perspective.- Returns:
- This is the usage price if any from the same source as the
unitPrice
. - Since:
- Cart Client 2.0.4
-
getTermDurationLength
The length of the terms, e.g., if this is 36 andtermDurationType
is MONTHS, then therecurringPrice
should be charged for 36 months.- Since:
- Cart Client 2.0.4
- See Also:
-
termDurationType
recurringPrice
-
getTermDurationType
The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.- Since:
- Cart Client 2.0.4
- See Also:
-
termDurationLength
recurringPrice
-
getAdjustmentsTotal
public javax.money.MonetaryAmount getAdjustmentsTotal()The total adjustment price for alladjustments
of aCartItem
.- Returns:
- The total adjustment price for all
adjustments
of aCartItem
.
-
getSubtotal
public javax.money.MonetaryAmount getSubtotal()- Returns:
- The subtotal price of this
CartItem
.
-
getTotal
public javax.money.MonetaryAmount getTotal()- Returns:
- The total price of this
CartItem
.
-
getPricingStrategy
For dependent cart items, this strategy is used to indicate how the price should be incorporated into the overall cart subtotal - i.e. whether this cart item's price should be added to the subtotal (theADD_TO_PARENT
strategy) or if the parent cart item's price already includes this item's price (theINCLUDED_IN_PARENT
strategy). By default, theADD_TO_PARENT
strategy is used. Note: Regardless of this strategy, if the dependent cart item has a relatedFulfillmentItem
, then there will likely be a tax amount related to the item which be included in the cart's overall price.- Returns:
- the pricing strategy for this item.
- See Also:
-
getPricingKey
System-wide unique identifier to configure specific pricing for this cart item. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Returns:
- a unique key to identify this product
-
getItemAdjustments
Adjustments to item pricing that should be applied togetSubtotal()
.- Returns:
- Adjustments to item pricing that should be applied to
getSubtotal()
.
-
getProratedOrderOfferAdjustments
public List<com.broadleafcommerce.order.common.domain.ProratedOfferAdjustment> getProratedOrderOfferAdjustments()Prorated adjustments for this item from order-level offers.This information is only needed for downstream services for uses like refund calculation, etc. Order-level offers are still applied at the cart level.
-
getVariantId
The id to the corresponding variant for this item.- Returns:
- The id to the corresponding variant for this item.
-
getProductId
The id to the corresponding product for this item.- Returns:
- The id to the corresponding product for this item.
-
getCategoryIds
The ids to the corresponding categories for this item's product. Used for validating item choice configuration and offers.- Returns:
- The ids to the corresponding categories for this item's product.
-
getProductTags
The list of simple labels used to categorize the corresponding product for this item.- Returns:
- The list of simple labels used to categorize the corresponding product for this item.
-
getSku
Represents a SKU code, similar to productId or variantId, except this is a unified, unique concept across both products and variants.- Returns:
- The SKU (or SKU code) for a product or variant
-
getImageAsset
The image asset for this item, usually sourced from the product.- Returns:
- The image asset for this item.
-
isDiscountable
public boolean isDiscountable()Whether or not this item can be applied to any offers or promotions.
Defaults to
true
- Returns:
- whether or not this item can be applied to any offers or promotions
-
getVendorRef
A reference to the corresponding vendor for this item.- Returns:
- A reference to the corresponding vendor for this item.
-
getMerchandisingContext
Defines the merchandising context of the item to signify where it is added from.This field is intended to be used for items added from SELECTOR products, which allows for the possibility of targeting the items for discounts based on the fact that they came from the SELECTOR product.
- Returns:
- The context of the item signifying where it's added from
-
getBrandId
The id to the corresponding data driven enum for this item's product's brand. Used for validating offers.- Returns:
- the id to the corresponding data driven enum for this item's product's brand
-
getMerchandisingTypeId
The id to the corresponding data driven enum for this item's product's merchandising type. Used for validating offers.- Returns:
- the id to the corresponding data driven enum for this item's product's merchandising type
-
getTargetDemographicId
The id to the corresponding data driven enum for this item's product's target demographic. Used for validating offers.- Returns:
- the id to the corresponding data driven enum for this item's product's target demographic
-
getAttributes
Miscellaneous attributes for this item.- Returns:
- Miscellaneous attributes for this item.
-
getInternalAttributes
Miscellaneous internal attributes for this item. Distinguished fromgetAttributes()
in that this map is used for attributes that assist in the internal working of Broadleaf MicroServices. For example, attributes to help with pricing of dependent items.- Returns:
- Miscellaneous internal attributes for this item.
-
getAttributeChoices
public Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> getAttributeChoices()Attribute choices for this item driven by product options, where each key is theattributeName
from an attribute choice.- Returns:
- Attribute choices for this item driven by product options, where each key is the
attributeName
from an attribute choice.
-
isPriced
public boolean isPriced()Flag to indicate whether this item has been priced.- Returns:
- Flag to indicate whether this item has been priced.
-
getGlobalConfigErrors
List of global configuration errors. API users and auditors can use this to see configuration errors.- Returns:
- List of global configuration errors
-
getAttributeConfigErrors
Map of configuration errors for related to this item'sattributeChoices
that are derived from ProductOptions where the key is the attribute name.- Returns:
- Map of configuration errors for related to this item's
attributeChoices
that are derived from ProductOptions where the key is the attribute name.
-
getDependentItemConfigErrors
Map of configuration errors for related to this item'sdependentCartItems
where the key is the item's identifier such as ProductOption choiceKey.- Returns:
- Map of configuration errors for related to this item's
dependentCartItems
.
-
getOverrideDetails
List of details about any price overrides which have been performed on this item.- Returns:
- List of details about any price overrides which have been performed on this item.
-
isTaxable
public boolean isTaxable()Whether this item is taxable.- Returns:
- Whether this item is taxable
-
getCartVersion
The Cart's version. Used for version checking when the cart is not part of the request. SeeCart.getVersion()
. -
getCart
The owning cart of this item.- Returns:
- the cart that owns this item
-
getType
The type of this cart item. SeeDefaultCartItemTypes
.- Returns:
- the type of this cart item
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
setId
The context ID of the cart.- Parameters:
id
- the context ID of the cart
-
setName
The name of this item. Typically derived from the product or sku name.- Parameters:
name
- The name of this item. Typically derived from the product or sku name.
-
setUri
The navigable uri of the corresponding catalog entry for this cart item.- Parameters:
uri
- The navigable uri of the corresponding catalog entry for this cart item.
-
setQuantity
The number of this item in theCart
.- Parameters:
quantity
- The number of this item in theCart
.
-
setDependentCartItems
-
setDependentItemDetails
If thisCartItem
is a dependent cart item, this contains additional details about the dependentCartItem's
dependency on its parent.This should always be populated for items within
getDependentCartItems()
, and should never be populated for non-dependent items.- Parameters:
dependentItemDetails
- details about the dependentCartItem's
dependency on its parent
-
setOverridePriceFlag
public void setOverridePriceFlag(boolean overridePriceFlag) Whether the price of thisCartItem
was specifically overridden, whether from a CSR or an automatic process.- Parameters:
overridePriceFlag
- Whether the price of thisCartItem
was specifically overridden, whether from a CSR or an automatic process.
-
setPriceListId
The id of the price list used to get the pricing for thisCartItem
.- Parameters:
priceListId
- The id of the price list used to get the pricing for thisCartItem
.
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) - Specified by:
setCurrency
in interfacecom.broadleafcommerce.money.CurrencyConsumer
-
setUnitPrice
public void setUnitPrice(javax.money.MonetaryAmount unitPrice) The individual unit price for aCartItem
.- Parameters:
unitPrice
- The individual unit price for aCartItem
.
-
setUnitPriceType
The type of the unit price for aCartItem
. Typically "salePrice", "standardPrice", or "basePrice".- Parameters:
unitPriceType
- The type of the unit price for aCartItem
.
-
setRecurringPriceTypeOverride
OverridesunitPriceType
for therecurringPrice
in cases where they must diverge. Usually only in Offer use cases where an offer cannot apply to a sale recurring price but can apply to the standard recurring price and we need to leave the upfront price as the sale priceāor vice versa.- Since:
- Cart Client 2.0.4
-
setRecurringPrice
public void setRecurringPrice(com.broadleafcommerce.order.common.domain.RecurringPriceDetail recurringPrice) This is the recurring price if any from the same source as theunitPrice
. The recurring price is used for subscriptions and is not expected to be charged at checkout typically.- Parameters:
recurringPrice
- This is the recurring price if any from the same source as theunitPrice
- Since:
- Cart Client 2.0.4
- See Also:
-
termDurationType
termDurationLength
-
setUsagePrice
public void setUsagePrice(com.broadleafcommerce.order.common.domain.UsagePriceDetail usagePrice) This is the usage price if any from the same source as theunitPrice
. The usage price represents a charge when an item is used, e.g., when using minutes above the base allowance. This is generally just information from a Cart's perspective.- Parameters:
usagePrice
- This is the usage price if any from the same source as theunitPrice
- Since:
- Cart Client 2.0.4
-
setTermDurationLength
The length of the terms, e.g., if this is 36 andtermDurationType
is MONTHS, then therecurringPrice
should be charged for 36 months.- Since:
- Cart Client 2.0.4
- See Also:
-
termDurationType
recurringPrice
-
setTermDurationType
The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.- Since:
- Cart Client 2.0.4
- See Also:
-
termDurationLength
recurringPrice
-
setAdjustmentsTotal
public void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The total adjustment price for alladjustments
of aCartItem
.- Parameters:
adjustmentsTotal
- The total adjustment price for alladjustments
of aCartItem
.
-
setSubtotal
public void setSubtotal(javax.money.MonetaryAmount subtotal) - Parameters:
subtotal
- The subtotal price of thisCartItem
.
-
setTotal
public void setTotal(javax.money.MonetaryAmount total) - Parameters:
total
- The total price of thisCartItem
.
-
setPricingStrategy
For dependent cart items, this strategy is used to indicate how the price should be incorporated into the overall cart subtotal - i.e. whether this cart item's price should be added to the subtotal (theADD_TO_PARENT
strategy) or if the parent cart item's price already includes this item's price (theINCLUDED_IN_PARENT
strategy). By default, theADD_TO_PARENT
strategy is used. Note: Regardless of this strategy, if the dependent cart item has a relatedFulfillmentItem
, then there will likely be a tax amount related to the item which be included in the cart's overall price.- Parameters:
pricingStrategy
- the pricing strategy for this item.- See Also:
-
setPricingKey
System-wide unique identifier to configure specific pricing for this cart item. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Parameters:
pricingKey
- a unique key to identify this product (usually a UUID)
-
setItemAdjustments
public void setItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> itemAdjustments) Adjustments to item pricing that should be applied togetSubtotal()
.- Parameters:
itemAdjustments
- Adjustments to item pricing that should be applied togetSubtotal()
.
-
setProratedOrderOfferAdjustments
public void setProratedOrderOfferAdjustments(List<com.broadleafcommerce.order.common.domain.ProratedOfferAdjustment> proratedOrderOfferAdjustments) Prorated adjustments for this item from order-level offers.This information is only needed for downstream services for uses like refund calculation, etc. Order-level offers are still applied at the cart level.
-
setVariantId
The id to the corresponding variant for this item.- Parameters:
variantId
- The id to the corresponding variant for this item.
-
setProductId
The id to the corresponding product for this item.- Parameters:
productId
- The id to the corresponding product for this item.
-
setCategoryIds
The ids to the corresponding categories for this item's product. Used for validating item choice configuration and offers.- Parameters:
categoryIds
- The ids to the corresponding categories for this item's product.
-
setProductTags
The list of simple labels used to categorize the corresponding product for this item.- Parameters:
productTags
- The list of simple labels used to categorize the corresponding product for this item.
-
setSku
Represents a SKU code, similar to productId or variantId, except this is a unified, unique concept across both products and variants.- Parameters:
sku
- The SKU (or SKU code) for a product or variant
-
setImageAsset
The image asset for this item, usually sourced from the product.- Parameters:
imageAsset
- The image asset for this item.
-
setDiscountable
public void setDiscountable(boolean discountable) Whether or not this item can be applied to any offers or promotions.
Defaults to
true
- Parameters:
discountable
- whether or not this item can be applied to any offers or promotions
-
setVendorRef
A reference to the corresponding vendor for this item.- Parameters:
vendorRef
- A reference to the corresponding vendor for this item.
-
setMerchandisingContext
Defines the merchandising context of the item to signify where it is added from.This field is intended to be used for items added from SELECTOR products, which allows for the possibility of targeting the items for discounts based on the fact that they came from the SELECTOR product.
- Parameters:
merchandisingContext
- The context of the item signifying where it's added from
-
setBrandId
The id to the corresponding data driven enum for this item's product's brand. Used for validating offers.- Parameters:
brandId
- the id to the corresponding data driven enum for this item's product's brand
-
setMerchandisingTypeId
The id to the corresponding data driven enum for this item's product's merchandising type. Used for validating offers.- Parameters:
merchandisingTypeId
- the id to the corresponding data driven enum for this item's product's merchandising type
-
setTargetDemographicId
The id to the corresponding data driven enum for this item's product's target demographic. Used for validating offers.- Parameters:
targetDemographicId
- the id to the corresponding data driven enum for this item's product's target demographic
-
setAttributes
Miscellaneous attributes for this item.- Parameters:
attributes
- Miscellaneous attributes for this item.
-
setInternalAttributes
Miscellaneous internal attributes for this item. Distinguished fromgetAttributes()
in that this map is used for attributes that assist in the internal working of Broadleaf MicroServices. For example, attributes to help with pricing of dependent items.- Parameters:
internalAttributes
- Miscellaneous internal attributes for this item.
-
setAttributeChoices
public void setAttributeChoices(Map<String, com.broadleafcommerce.order.common.domain.AttributeChoiceValue> attributeChoices) Attribute choices for this item driven by product options, where each key is theattributeName
from an attribute choice.- Parameters:
attributeChoices
- Attribute choices for this item driven by product options, where each key is theattributeName
from an attribute choice.
-
setPriced
public void setPriced(boolean isPriced) Flag to indicate whether this item has been priced.- Parameters:
isPriced
- Flag to indicate whether this item has been priced.
-
setGlobalConfigErrors
List of global configuration errors. API users and auditors can use this to see configuration errors.- Parameters:
globalConfigErrors
- List of global configuration errors.
-
setAttributeConfigErrors
Map of configuration errors for related to this item'sattributeChoices
that are derived from ProductOptions where the key is the attribute name.- Parameters:
attributeConfigErrors
- Map of configuration errors for related to this item'sattributeChoices
that are derived from ProductOptions where the key is the attribute name.
-
setDependentItemConfigErrors
Map of configuration errors for related to this item'sdependentCartItems
where the key is the item's identifier such as ProductOption choiceKey.- Parameters:
dependentItemConfigErrors
- Map of configuration errors for related to this item'sdependentCartItems
.
-
setOverrideDetails
public void setOverrideDetails(List<com.broadleafcommerce.order.common.domain.OverrideDetail> overrideDetails) List of details about any price overrides which have been performed on this item.- Parameters:
overrideDetails
- List of details about any price overrides which have been performed on this item.
-
setTaxable
public void setTaxable(boolean taxable) Whether this item is taxable.- Parameters:
taxable
- Whether this item is taxable
-
setCartVersion
The Cart's version. Used for version checking when the cart is not part of the request. SeeCart.getVersion()
. -
setCart
The owning cart of this item.- Parameters:
cart
- the cart that should own this item
-
setType
The type of this cart item. SeeDefaultCartItemTypes
.- Parameters:
type
- the type of the cart item
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
DefaultCartItemTypes