Class OrderItem
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,Serializable
Order
. Contains information related to pricing, quantity, and external
object references.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
javax.money.MonetaryAmount
The total adjustment price for alladjustments
of anOrderItem
.Attribute choices for this item driven by product options, where each key is theattributeName
from an attribute choice.Miscellaneous attributes for this item.The id to the corresponding data driven enum for this item's product's brand.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.protected javax.money.CurrencyUnit
OrderItems
that depend on thisOrderItem
.getId()
The context ID of the order.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.getOrder()
The owning order 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 thisOrderItem
.The pricing strategy for this item.The id to the corresponding product for this item.The list of simple labels used to categorize the corresponding product for this item.javax.money.MonetaryAmount
The amount prorated to this item from order adjustments.int
The number of this item in theOrder
.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
javax.money.MonetaryAmount
The pre-calculated merchandise amount to refund when thisOrderItem
is returned.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 thisOrderItem
.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 thisOrderItem
.getType()
The type of this item.javax.money.MonetaryAmount
The individual unit price for anOrderItem
.The type of the unit price for anOrderItem
.getUri()
The navigable uri of the corresponding catalog entry (e.g.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.int
hashCode()
boolean
Whether or not this item can be applied to any offers or promotions.boolean
Whether the price of thisOrderItem
was specifically overridden, whether from a CSR or an automatic process.void
setAdjustmentsTotal
(javax.money.MonetaryAmount adjustmentsTotal) The total adjustment price for alladjustments
of anOrderItem
.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
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
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
setDependentOrderItems
(List<OrderItem> dependentOrderItems) OrderItems
that depend on thisOrderItem
.void
setDiscountable
(boolean discountable) Whether or not this item can be applied to any offers or promotions.void
The context ID of the order.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
The owning order 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 thisOrderItem
was specifically overridden, whether from a CSR or an automatic process.void
setPriceListId
(String priceListId) The id of the price list used to get the pricing for thisOrderItem
.void
setPricingStrategy
(String pricingStrategy) The pricing strategy for this item.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
setProratedOrderAdjustments
(javax.money.MonetaryAmount proratedOrderAdjustments) The amount prorated to this item from order adjustments.void
setQuantity
(int quantity) The number of this item in theOrder
.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
setRefundAmount
(javax.money.MonetaryAmount refundAmount) The pre-calculated merchandise amount to refund when thisOrderItem
is returned.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 thisOrderItem
.void
setTargetDemographicId
(String targetDemographicId) The id to the corresponding data driven enum for this item's product's target demographic.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 thisOrderItem
.void
The type of this item.void
setUnitPrice
(javax.money.MonetaryAmount unitPrice) The individual unit price for anOrderItem
.void
setUnitPriceType
(String unitPriceType) The type of the unit price for anOrderItem
.void
The navigable uri of the corresponding catalog entry (e.g.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
-
OrderItem
public OrderItem()
-
-
Method Details
-
getRecurringPeriodTypeWithDependentItems
- Since:
- Order Client 2.0.3
-
getRecurringPriceWithDependentItems
public javax.money.MonetaryAmount getRecurringPriceWithDependentItems()- Since:
- Order Client 2.0.3
-
getRecurringSubtotalWithDependentItems
public javax.money.MonetaryAmount getRecurringSubtotalWithDependentItems()- Since:
- Order Client 2.0.3
-
getRecurringAdjustmentsTotalWithDependentItems
public javax.money.MonetaryAmount getRecurringAdjustmentsTotalWithDependentItems()- Since:
- Order Client 2.0.3
-
getRecurringTotalWithDependentItems
public javax.money.MonetaryAmount getRecurringTotalWithDependentItems()- Since:
- Order Client 2.0.3
-
getCurrency
protected javax.money.CurrencyUnit getCurrency()- Since:
- Order Client 2.0.3
-
getId
The context ID of the order.- Returns:
- the context ID of the order
-
getOrder
The owning order of this item.- Returns:
- the order that owns this item
-
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 (e.g. product) for this order item.- Returns:
- The navigable uri of the corresponding catalog entry (e.g. product) for this order item.
-
getQuantity
public int getQuantity()The number of this item in theOrder
.- Returns:
- The number of this item in the
Order
.
-
isOverridePriceFlag
public boolean isOverridePriceFlag()Whether the price of thisOrderItem
was specifically overridden, whether from a CSR or an automatic process.- Returns:
- Whether the price of this
OrderItem
was specifically overridden, whether from a CSR or an automatic process.
-
getPriceListId
The id of the price list used to get the pricing for thisOrderItem
.- Returns:
- The id of the price list used to get the pricing for this
OrderItem
.
-
getUnitPrice
public javax.money.MonetaryAmount getUnitPrice()The individual unit price for anOrderItem
.- Returns:
- The individual unit price for an
OrderItem
.
-
getUnitPriceType
The type of the unit price for anOrderItem
. Typically "salePrice", "standardPrice", or "basePrice".- Returns:
- The type of the unit price for an
OrderItem
.
-
getAdjustmentsTotal
public javax.money.MonetaryAmount getAdjustmentsTotal()The total adjustment price for alladjustments
of anOrderItem
.- Returns:
- The total adjustment price for all
adjustments
of aOrderItem
.
-
getSubtotal
public javax.money.MonetaryAmount getSubtotal()- Returns:
- The subtotal price of this
OrderItem
.
-
getTotal
public javax.money.MonetaryAmount getTotal()- Returns:
- The total price of this
OrderItem
.
-
getProratedOrderAdjustments
public javax.money.MonetaryAmount getProratedOrderAdjustments()The amount prorated to this item from order adjustments.- Returns:
- the amount prorated to this item from order adjustments
-
getRefundAmount
public javax.money.MonetaryAmount getRefundAmount()The pre-calculated merchandise amount to refund when thisOrderItem
is returned.By default, the
proratedOrderAdjustments
are included. For example, if this item has an amount of $10 and has a prorated order adjustment of $2, the refund amount would be $8.- Returns:
- The pre-calculated merchandise amount to refund when this
OrderItem
is returned
-
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:
- Order Client 2.0.3
- See Also:
-
termDurationType
termDurationLength
-
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:
- Order Client 2.0.3
-
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:
- Order Client 2.0.3
-
getTermDurationLength
The length of the terms, e.g., if this is 36 andtermDurationType
is MONTHS, then therecurringPrice
should be charged for 36 months.- Since:
- Order Client 2.0.3
- See Also:
-
termDurationType
recurringPrice
-
getTermDurationType
The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.- Since:
- Order Client 2.0.3
- See Also:
-
termDurationLength
recurringPrice
-
getPricingStrategy
The pricing strategy for this item.- Returns:
- the pricing strategy for this item.*
-
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
-
getDependentOrderItems
OrderItems
that depend on thisOrderItem
. Also could be called "child items".- Returns:
OrderItems
that depend on thisOrderItem
. Also could be called "child items".
-
getItemAdjustments
Adjustments to item pricing that should be applied togetSubtotal()
.- Returns:
- Adjustments to item pricing that should be applied to
getSubtotal()
.
-
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.
-
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.
-
getType
The type of this item. SeeDefaultOrderItemTypes
.- Returns:
- the type of this 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 order.- Parameters:
id
- the context ID of the order
-
setOrder
The owning order of this item.- Parameters:
order
- the order that should own this item
-
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 (e.g. product) for this order item.- Parameters:
uri
- The navigable uri of the corresponding catalog entry (e.g. product) for this order item.
-
setQuantity
public void setQuantity(int quantity) The number of this item in theOrder
.- Parameters:
quantity
- The number of this item in theOrder
.
-
setOverridePriceFlag
public void setOverridePriceFlag(boolean overridePriceFlag) Whether the price of thisOrderItem
was specifically overridden, whether from a CSR or an automatic process.- Parameters:
overridePriceFlag
- Whether the price of thisOrderItem
was specifically overridden, whether from a CSR or an automatic process.
-
setPriceListId
The id of the price list used to get the pricing for thisOrderItem
.- Parameters:
priceListId
- The id of the price list used to get the pricing for thisOrderItem
.
-
setUnitPrice
public void setUnitPrice(javax.money.MonetaryAmount unitPrice) The individual unit price for anOrderItem
.- Parameters:
unitPrice
- The individual unit price for anOrderItem
.
-
setUnitPriceType
The type of the unit price for anOrderItem
. Typically "salePrice", "standardPrice", or "basePrice".- Parameters:
unitPriceType
- The type of the unit price for anOrderItem
.
-
setAdjustmentsTotal
public void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The total adjustment price for alladjustments
of anOrderItem
.- Parameters:
adjustmentsTotal
- The total adjustment price for alladjustments
of anOrderItem
.
-
setSubtotal
public void setSubtotal(javax.money.MonetaryAmount subtotal) - Parameters:
subtotal
- The subtotal price of thisOrderItem
.
-
setTotal
public void setTotal(javax.money.MonetaryAmount total) - Parameters:
total
- The total price of thisOrderItem
.
-
setProratedOrderAdjustments
public void setProratedOrderAdjustments(javax.money.MonetaryAmount proratedOrderAdjustments) The amount prorated to this item from order adjustments.- Parameters:
proratedOrderAdjustments
- the amount prorated to this item from order adjustments
-
setRefundAmount
public void setRefundAmount(javax.money.MonetaryAmount refundAmount) The pre-calculated merchandise amount to refund when thisOrderItem
is returned.By default, the
proratedOrderAdjustments
are included. For example, if this item has an amount of $10 and has a prorated order adjustment of $2, the refund amount would be $8.- Parameters:
refundAmount
- The pre-calculated merchandise amount to refund when thisOrderItem
is returned
-
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:
- Order Client 2.0.3
- See Also:
-
termDurationType
termDurationLength
-
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:
- Order Client 2.0.3
-
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:
- Order Client 2.0.3
-
setTermDurationLength
The length of the terms, e.g., if this is 36 andtermDurationType
is MONTHS, then therecurringPrice
should be charged for 36 months.- Since:
- Order Client 2.0.3
- See Also:
-
termDurationType
recurringPrice
-
setTermDurationType
The term duration type, e.g. DAYS, WEEKS, MONTHS, YEARS.- Since:
- Order Client 2.0.3
- See Also:
-
termDurationLength
recurringPrice
-
setPricingStrategy
The pricing strategy for this item.- Parameters:
pricingStrategy
- the pricing strategy for this item.
-
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:
contentUrl
- 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
-
setDependentOrderItems
OrderItems
that depend on thisOrderItem
. Also could be called "child items".- Parameters:
dependentOrderItems
-OrderItems
that depend on thisOrderItem
. Also could be called "child items".
-
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()
.
-
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.
-
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.
-
setType
The type of this item. SeeDefaultOrderItemTypes
.- Parameters:
type
- the type of the 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
-