Class CheckoutCart
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,com.broadleafcommerce.money.CurrencyConsumer,Serializable,javax.money.CurrencySupplier
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanList<com.broadleafcommerce.order.common.domain.Adjustment>Adjustments to order pricing that should be applied toCartPricing.getSubtotal().The time this cart was submitted for approval.The cart approver's email address.The email of the assigned sales rep.The id of the assigned sales rep.Attribute choices for this cart driven by its items' product options, where each key is theattributeNamefrom an attribute choice.Miscellaneous attributes for this cart.List<com.broadleafcommerce.order.common.domain.CampaignRef>A list of campaign references that are attached to this cart.getCart()The list of the alerts for thisCart.Items that are contained within this cart.Embedded container for all pricing information on this cart.The checkout submissions made for this cart where each key is the request ID of a checkout and the value is anInstanttimestamp of when the checkout was made.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.The date that this cart was first created.javax.money.CurrencyUnitcom.broadleafcommerce.order.common.domain.CustomerRefA reference to the customer that owns this cart.The customer's email address.The expiration date of the cart.List<com.broadleafcommerce.order.common.domain.Adjustment>A list of fulfillment groupAdjustments.A list of fulfillment information for this cart.List<com.broadleafcommerce.order.common.domain.Adjustment>A list of fulfillment itemAdjustments.getId()The context ID of the cart.Miscellaneous internal attributes for this item.List<com.broadleafcommerce.order.common.domain.Adjustment>A list of cart itemAdjustments.The last time the cart was fully repriced with the most updated catalog pricing.The id of this cart's most recent audit.getLinks()A map ofCartLinkby a link key.The locale for this cart.getName()A unique name for the cart, used for retrieval.A list of offer codes that a user has added to their cart.The unique number associated with thisCart.intReturns the sum of the quantities of all theCart.cartItems.The estimated recurring adjustments total for the first period discounted for all items grouped by their recurring period type.The estimated recurring subtotal for the first period discounted for all items grouped by their recurring period type.The estimated recurring total for the first period discounted for all items grouped by their recurring period type.The status of this cart.The date that this cart was submitted.getType()The type of cart.The version of this cart.List<com.broadleafcommerce.order.common.domain.Voucher>A list ofVouchersthat thisCartis qualifier for.inthashCode()booleanReturns whether or not the cart is for an anonymous user.booleanisPriced()Flag to indicate whether this cart has been fully priced.booleanFlag to indicate whether the taxes on the cart are estimates.voidsetAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> adjustments) Adjustments to order pricing that should be applied toCartPricing.getSubtotal().voidsetApprovalRequestedDate(Instant approvalRequestedDate) The time this cart was submitted for approval.voidsetApproverEmail(String approverEmail) The cart approver's email address.voidsetAssignedSalesRepEmail(String assignedSalesRepEmail) The email of the assigned sales rep.voidsetAssignedSalesRepId(String assignedSalesRepId) The id of the assigned sales rep.voidsetAttributeChoices(Map<String, com.broadleafcommerce.order.common.domain.AttributeChoiceValue> attributeChoices) Attribute choices for this cart driven by its items' product options, where each key is theattributeNamefrom an attribute choice.voidsetAttributes(Map<String, Object> attributes) Miscellaneous attributes for this cart.voidsetCampaignRefs(List<com.broadleafcommerce.order.common.domain.CampaignRef> campaignRefs) A list of campaign references that are attached to this cart.voidvoidsetCartAlerts(List<CartAlert> cartAlerts) The list of the alerts for thisCart.voidsetCartItems(List<CartItem> cartItems) Items that are contained within this cart.voidsetCartPricing(CartPricing cartPricing) Embedded container for all pricing information on this cart.voidsetCheckoutSubmissions(Map<String, Instant> checkoutSubmissions) The checkout submissions made for this cart where each key is the request ID of a checkout and the value is anInstanttimestamp of when the checkout was made.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetCreateDate(Instant createDate) The date that this cart was first created.voidsetCurrency(javax.money.CurrencyUnit currencyUnit) voidsetCustomerRef(com.broadleafcommerce.order.common.domain.CustomerRef customerRef) A reference to the customer that owns this cart.voidsetEmailAddress(String emailAddress) The customer's email address.voidsetExpirationDate(Instant expirationDate) The expiration date of the cart.voidsetFulfillmentGroupAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentGroupAdjustments) A list of fulfillment groupAdjustments.voidsetFulfillmentGroups(List<FulfillmentGroup> fulfillmentGroups) A list of fulfillment information for this cart.voidsetFulfillmentItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentItemAdjustments) A list of fulfillment itemAdjustments.voidThe context ID of the cart.voidsetInternalAttributes(Map<String, Object> internalAttributes) Miscellaneous internal attributes for this item.voidsetItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> itemAdjustments) A list of cart itemAdjustments.voidsetLastCatalogReprice(Instant lastCatalogReprice) The last time the cart was fully repriced with the most updated catalog pricing.voidsetLastUpdatedAudit(CartActionAudit lastUpdatedAudit) The id of this cart's most recent audit.voidA map ofCartLinkby a link key.voidThe locale for this cart.voidA unique name for the cart, used for retrieval.voidsetOfferCodes(List<String> offerCodes) A list of offer codes that a user has added to their cart.voidsetOrderNumber(String orderNumber) The unique number associated with thisCart.voidsetPriced(boolean isPriced) Flag to indicate whether this cart has been fully priced.voidThe status of this cart.voidsetSubmitDate(Instant submitDate) The date that this cart was submitted.voidsetTaxEstimated(boolean isTaxEstimated) Flag to indicate whether the taxes on the cart are estimates.voidThe type of cart.voidsetVersion(Integer version) The version of this cart.voidsetVouchers(List<com.broadleafcommerce.order.common.domain.Voucher> vouchers) A list ofVouchersthat thisCartis qualifier for.toString()
-
Field Details
-
CART_ITEM_LINK_KEY
- See Also:
-
FULFILLMENT_GROUP_LINK_KEY
- See Also:
-
-
Constructor Details
-
CheckoutCart
public CheckoutCart()
-
-
Method Details
-
getLinks
A map ofCartLinkby a link key. -
getItemAdjustments
A list of cart itemAdjustments. -
getFulfillmentGroupAdjustments
A list of fulfillment groupAdjustments. -
getFulfillmentItemAdjustments
A list of fulfillment itemAdjustments. -
getCart
-
setLinks
A map ofCartLinkby a link key. -
setItemAdjustments
public void setItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> itemAdjustments) A list of cart itemAdjustments. -
setFulfillmentGroupAdjustments
public void setFulfillmentGroupAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentGroupAdjustments) A list of fulfillment groupAdjustments. -
setFulfillmentItemAdjustments
public void setFulfillmentItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentItemAdjustments) A list of fulfillment itemAdjustments. -
setCart
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getQuantity
public int getQuantity()Description copied from class:CartReturns the sum of the quantities of all theCart.cartItems.- Overrides:
getQuantityin classCart- Returns:
- the sum of the quantities of all the
Cart.cartItems.
-
isAnonymous
public boolean isAnonymous()Description copied from class:CartReturns whether or not the cart is for an anonymous user.- Overrides:
isAnonymousin classCart- Returns:
- whether or not the cart is for an anonymous user.
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currencyUnit) - Specified by:
setCurrencyin interfacecom.broadleafcommerce.money.CurrencyConsumer- Overrides:
setCurrencyin classCart
-
getCurrency
public javax.money.CurrencyUnit getCurrency()- Specified by:
getCurrencyin interfacejavax.money.CurrencySupplier- Overrides:
getCurrencyin classCart
-
getCartItemsWithDependentItems
- Overrides:
getCartItemsWithDependentItemsin classCart
-
getRecurringSubtotals
Description copied from class:CartThe estimated recurring subtotal for the first period discounted for all items grouped by their recurring period type.- Overrides:
getRecurringSubtotalsin classCart
-
getRecurringAdjustmentsTotals
Description copied from class:CartThe estimated recurring adjustments total for the first period discounted for all items grouped by their recurring period type.- Overrides:
getRecurringAdjustmentsTotalsin classCart
-
getRecurringTotals
Description copied from class:CartThe estimated recurring total for the first period discounted for all items grouped by their recurring period type.- Overrides:
getRecurringTotalsin classCart
-
getId
Description copied from class:CartThe context ID of the cart. -
getName
Description copied from class:CartA unique name for the cart, used for retrieval. This field is not displayed anywhere. -
getType
Description copied from class:CartThe type of cart. -
getStatus
Description copied from class:CartThe status of this cart. -
getCustomerRef
public com.broadleafcommerce.order.common.domain.CustomerRef getCustomerRef()Description copied from class:CartA reference to the customer that owns this cart.- Overrides:
getCustomerRefin classCart- Returns:
- A reference to the customer that owns this cart.
-
getApprovalRequestedDate
Description copied from class:CartThe time this cart was submitted for approval.This field is only needed for B2B carts to represent the cart approval process. For B2C carts, we don't expect a value to be provided for this field.
- Overrides:
getApprovalRequestedDatein classCart
-
getApproverEmail
Description copied from class:CartThe cart approver's email address.This field is only needed for B2B carts to represent the cart approver's email address. For B2C carts, we don't expect a value to be provided for this field.
- Overrides:
getApproverEmailin classCart- Returns:
- The cart approver's email address.
-
getEmailAddress
Description copied from class:CartThe customer's email address.- Overrides:
getEmailAddressin classCart- Returns:
- The customer's email address.
-
getOrderNumber
Description copied from class:CartThe unique number associated with thisCart. Typically, this is generated and set on cart submission. Used for record keeping and communicating with the customer instead of just usingCart.getId()since that exposes unwanted information about your database.- Overrides:
getOrderNumberin classCart- Returns:
- The unique number associated with this
Cart.
-
getCreateDate
Description copied from class:CartThe date that this cart was first created.- Overrides:
getCreateDatein classCart- Returns:
- The date that this cart was first created.
-
getSubmitDate
Description copied from class:CartThe date that this cart was submitted. Only set if thecart statusisDefaultCartStatuses.SUBMITTED, otherwise null.- Overrides:
getSubmitDatein classCart- Returns:
- The date that this cart was submitted.
- See Also:
-
getLocale
Description copied from class:CartThe locale for this cart. Used to determine what locale this cart was in for translations and other location-based functionality. -
getCartPricing
Description copied from class:CartEmbedded container for all pricing information on this cart.- Overrides:
getCartPricingin classCart- Returns:
- Embedded container for all pricing information on this cart.
-
getCartItems
Description copied from class:CartItems that are contained within this cart. Typically represents a good or service that the customer is purchasing.- Overrides:
getCartItemsin classCart- Returns:
- Items for purchase that are contained within this cart.
-
getFulfillmentGroups
Description copied from class:CartA list of fulfillment information for this cart. A cart can have many fulfillment groups associated with it in order to support multi-address and multi-type shipping.- Overrides:
getFulfillmentGroupsin classCart- Returns:
- A list of fulfillment information for this cart.
-
getAdjustments
Description copied from class:CartAdjustments to order pricing that should be applied toCartPricing.getSubtotal().- Overrides:
getAdjustmentsin classCart- Returns:
- Adjustments to order pricing that should be applied to
CartPricing.getSubtotal().
-
getOfferCodes
Description copied from class:CartA list of offer codes that a user has added to their cart. Can be used to applyAdjustmentsto different aspects of the order.- Overrides:
getOfferCodesin classCart- Returns:
- A list of offer codes that a user has added to their cart.
-
getVouchers
Description copied from class:CartA list ofVouchersthat thisCartis qualifier for.This mainly serves as a temporary storage and for UI display, the
Voucherswill not be processed until the order is completed.- Overrides:
getVouchersin classCart
-
getCampaignRefs
Description copied from class:CartA list of campaign references that are attached to this cart. Similar toCart.getOfferCodes(), theCampaignRef.getCampaignTrackingId()can be used to applyAdjustmentsto different aspects of the order. The difference is that these items need to be validated against a valid "Campaign" before being added to this list.- Overrides:
getCampaignRefsin classCart- Returns:
- A list of campaign references that are attached to this cart.
-
getAssignedSalesRepId
Description copied from class:CartThe id of the assigned sales rep.This is field is only used for
quotesfor the sales rep review process.- Overrides:
getAssignedSalesRepIdin classCart
-
getAssignedSalesRepEmail
Description copied from class:CartThe email of the assigned sales rep.This is field is only used for
quotesfor the sales rep review process.- Overrides:
getAssignedSalesRepEmailin classCart
-
getAttributes
Description copied from class:CartMiscellaneous attributes for this cart.- Overrides:
getAttributesin classCart- Returns:
- Miscellaneous attributes for this cart.
-
getInternalAttributes
Description copied from class:CartMiscellaneous internal attributes for this item. Distinguished fromCart.getAttributes()in that this map is used for attributes that assist in the internal working of Broadleaf MicroServices. For example, attributes to help with processing the cart's checkout.- Overrides:
getInternalAttributesin classCart- Returns:
- Miscellaneous internal attributes for this item.
-
getAttributeChoices
public Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> getAttributeChoices()Description copied from class:CartAttribute choices for this cart driven by its items' product options, where each key is theattributeNamefrom an attribute choice.- Overrides:
getAttributeChoicesin classCart- Returns:
- Attribute choices for this cart driven by its items' product options, where each key
is the
attributeNamefrom an attribute choice.
-
getCheckoutSubmissions
Description copied from class:CartThe checkout submissions made for this cart where each key is the request ID of a checkout and the value is anInstanttimestamp of when the checkout was made.- Overrides:
getCheckoutSubmissionsin classCart- Returns:
- The checkout submissions made for this cart where each key is the request ID and the
value is an
Instanttimestamp of when the checkout was made.
-
isPriced
public boolean isPriced()Description copied from class:CartFlag to indicate whether this cart has been fully priced. This means totalling of items, adjustments, shipping and tax. -
isTaxEstimated
public boolean isTaxEstimated()Description copied from class:CartFlag to indicate whether the taxes on the cart are estimates.- Overrides:
isTaxEstimatedin classCart- Returns:
- Flag to indicate whether the taxes on the cart are estimates.
-
getVersion
Description copied from class:CartThe version of this cart. Used for checking that the requested version of the cart is up-to-date before saving changes. Required for any request which results in an update being made to the cart. This should never be manually incremented/decremented.- Overrides:
getVersionin classCart
-
getCartAlerts
Description copied from class:CartThe list of the alerts for thisCart. NOTE: This is a transient property that is not persisted in the database.- Overrides:
getCartAlertsin classCart- Returns:
- the list of the cart alerts
-
getLastCatalogReprice
Description copied from class:CartThe last time the cart was fully repriced with the most updated catalog pricing.- Overrides:
getLastCatalogRepricein classCart- Returns:
- The last time the cart was fully repriced with the most updated catalog pricing.
-
getExpirationDate
Description copied from class:CartThe expiration date of the cart. This is typically only used forDefaultCartTypes.QUOTE-typed carts.- Overrides:
getExpirationDatein classCart
-
getLastUpdatedAudit
Description copied from class:CartThe id of this cart's most recent audit.- Overrides:
getLastUpdatedAuditin classCart
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()Description copied from class:CartA subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Overrides:
getContextStatein classCart- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
Description copied from class:CartThe context ID of the cart. -
setName
Description copied from class:CartA unique name for the cart, used for retrieval. This field is not displayed anywhere. -
setType
Description copied from class:CartThe type of cart. -
setStatus
Description copied from class:CartThe status of this cart. -
setCustomerRef
public void setCustomerRef(com.broadleafcommerce.order.common.domain.CustomerRef customerRef) Description copied from class:CartA reference to the customer that owns this cart.- Overrides:
setCustomerRefin classCart- Parameters:
customerRef- A reference to the customer that owns this cart.
-
setApprovalRequestedDate
Description copied from class:CartThe time this cart was submitted for approval.This field is only needed for B2B carts to represent the cart approval process. For B2C carts, we don't expect a value to be provided for this field.
- Overrides:
setApprovalRequestedDatein classCart
-
setApproverEmail
Description copied from class:CartThe cart approver's email address.This field is only needed for B2B carts to represent the cart approver's email address. For B2C carts, we don't expect a value to be provided for this field.
- Overrides:
setApproverEmailin classCart- Parameters:
approverEmail- The cart approver's email address.
-
setEmailAddress
Description copied from class:CartThe customer's email address.- Overrides:
setEmailAddressin classCart- Parameters:
emailAddress- The customer's email address.
-
setOrderNumber
Description copied from class:CartThe unique number associated with thisCart. Typically, this is generated and set on cart submission. Used for record keeping and communicating with the customer instead of just usingCart.getId()since that exposes unwanted information about your database.- Overrides:
setOrderNumberin classCart- Parameters:
orderNumber- The unique number associated with thisCart.
-
setCreateDate
Description copied from class:CartThe date that this cart was first created.- Overrides:
setCreateDatein classCart- Parameters:
createDate- The date that this cart was first created.
-
setSubmitDate
Description copied from class:CartThe date that this cart was submitted. Only set if thecart statusisDefaultCartStatuses.SUBMITTED, otherwise null.- Overrides:
setSubmitDatein classCart- Parameters:
submitDate- The date that this cart was submitted.- See Also:
-
setLocale
Description copied from class:CartThe locale for this cart. Used to determine what locale this cart was in for translations and other location-based functionality. -
setCartPricing
Description copied from class:CartEmbedded container for all pricing information on this cart.- Overrides:
setCartPricingin classCart- Parameters:
cartPricing- Embedded container for all pricing information on this cart.
-
setCartItems
Description copied from class:CartItems that are contained within this cart. Typically represents a good or service that the customer is purchasing.- Overrides:
setCartItemsin classCart- Parameters:
cartItems- Items for purchase that are contained within this cart.
-
setFulfillmentGroups
Description copied from class:CartA list of fulfillment information for this cart. A cart can have many fulfillment groups associated with it in order to support multi-address and multi-type shipping.- Overrides:
setFulfillmentGroupsin classCart- Parameters:
fulfillmentGroups- A list of fulfillment information for this cart.
-
setAdjustments
Description copied from class:CartAdjustments to order pricing that should be applied toCartPricing.getSubtotal().- Overrides:
setAdjustmentsin classCart- Parameters:
adjustments- Adjustments to order pricing that should be applied toCartPricing.getSubtotal().
-
setOfferCodes
Description copied from class:CartA list of offer codes that a user has added to their cart. Can be used to applyAdjustmentsto different aspects of the order.- Overrides:
setOfferCodesin classCart- Parameters:
offerCodes- A list of offer codes that a user has added to their cart.
-
setVouchers
Description copied from class:CartA list ofVouchersthat thisCartis qualifier for.This mainly serves as a temporary storage and for UI display, the
Voucherswill not be processed until the order is completed.- Overrides:
setVouchersin classCart
-
setCampaignRefs
public void setCampaignRefs(List<com.broadleafcommerce.order.common.domain.CampaignRef> campaignRefs) Description copied from class:CartA list of campaign references that are attached to this cart. Similar toCart.getOfferCodes(), theCampaignRef.getCampaignTrackingId()can be used to applyAdjustmentsto different aspects of the order. The difference is that these items need to be validated against a valid "Campaign" before being added to this list.- Overrides:
setCampaignRefsin classCart- Parameters:
campaignRefs- A list of campaign references that are attached to this cart.
-
setAssignedSalesRepId
Description copied from class:CartThe id of the assigned sales rep.This is field is only used for
quotesfor the sales rep review process.- Overrides:
setAssignedSalesRepIdin classCart
-
setAssignedSalesRepEmail
Description copied from class:CartThe email of the assigned sales rep.This is field is only used for
quotesfor the sales rep review process.- Overrides:
setAssignedSalesRepEmailin classCart
-
setAttributes
Description copied from class:CartMiscellaneous attributes for this cart.- Overrides:
setAttributesin classCart- Parameters:
attributes- Miscellaneous attributes for this cart.
-
setInternalAttributes
Description copied from class:CartMiscellaneous internal attributes for this item. Distinguished fromCart.getAttributes()in that this map is used for attributes that assist in the internal working of Broadleaf MicroServices. For example, attributes to help with processing the cart's checkout.- Overrides:
setInternalAttributesin classCart- Parameters:
internalAttributes- Miscellaneous internal attributes for this item.
-
setAttributeChoices
public void setAttributeChoices(Map<String, com.broadleafcommerce.order.common.domain.AttributeChoiceValue> attributeChoices) Description copied from class:CartAttribute choices for this cart driven by its items' product options, where each key is theattributeNamefrom an attribute choice.- Overrides:
setAttributeChoicesin classCart- Parameters:
attributeChoices- Attribute choices for this cart driven by its items' product options, where each key is theattributeNamefrom an attribute choice.
-
setCheckoutSubmissions
Description copied from class:CartThe checkout submissions made for this cart where each key is the request ID of a checkout and the value is anInstanttimestamp of when the checkout was made.- Overrides:
setCheckoutSubmissionsin classCart- Parameters:
checkoutSubmissions- The checkout submissions made for this cart where each key is the request ID of a checkout and the value is anInstanttimestamp of when the checkout was made.
-
setPriced
public void setPriced(boolean isPriced) Description copied from class:CartFlag to indicate whether this cart has been fully priced. This means totalling of items, adjustments, shipping and tax. -
setTaxEstimated
public void setTaxEstimated(boolean isTaxEstimated) Description copied from class:CartFlag to indicate whether the taxes on the cart are estimates.- Overrides:
setTaxEstimatedin classCart- Parameters:
isTaxEstimated- Flag to indicate whether the taxes on the cart are estimates.
-
setVersion
Description copied from class:CartThe version of this cart. Used for checking that the requested version of the cart is up-to-date before saving changes. Required for any request which results in an update being made to the cart. This should never be manually incremented/decremented.- Overrides:
setVersionin classCart
-
setCartAlerts
Description copied from class:CartThe list of the alerts for thisCart. NOTE: This is a transient property that is not persisted in the database.- Overrides:
setCartAlertsin classCart- Parameters:
cartAlerts- the list of the cart alerts
-
setLastCatalogReprice
Description copied from class:CartThe last time the cart was fully repriced with the most updated catalog pricing.- Overrides:
setLastCatalogRepricein classCart- Parameters:
lastCatalogReprice- The last time the cart was fully repriced with the most updated catalog pricing.
-
setExpirationDate
Description copied from class:CartThe expiration date of the cart. This is typically only used forDefaultCartTypes.QUOTE-typed carts.- Overrides:
setExpirationDatein classCart
-
setLastUpdatedAudit
Description copied from class:CartThe id of this cart's most recent audit.- Overrides:
setLastUpdatedAuditin classCart
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) Description copied from class:CartA subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Overrides:
setContextStatein classCart- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-