Class CheckoutCart

java.lang.Object
com.broadleafcommerce.cart.client.domain.Cart
com.broadleafcommerce.cart.client.domain.CheckoutCart
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.money.CurrencyConsumer, Serializable, javax.money.CurrencySupplier

public class CheckoutCart extends Cart
See Also:
  • Field Details

  • Constructor Details

    • CheckoutCart

      public CheckoutCart()
  • Method Details

    • getLinks

      public Map<String,CartLink> getLinks()
      A map of CartLink by a link key.
    • getItemAdjustments

      public List<com.broadleafcommerce.order.common.domain.Adjustment> getItemAdjustments()
      A list of cart item Adjustments.
    • getFulfillmentGroupAdjustments

      public List<com.broadleafcommerce.order.common.domain.Adjustment> getFulfillmentGroupAdjustments()
      A list of fulfillment group Adjustments.
    • getFulfillmentItemAdjustments

      public List<com.broadleafcommerce.order.common.domain.Adjustment> getFulfillmentItemAdjustments()
      A list of fulfillment item Adjustments.
    • getCart

      public Cart getCart()
    • setLinks

      public void setLinks(Map<String,CartLink> links)
      A map of CartLink by a link key.
    • setItemAdjustments

      public void setItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> itemAdjustments)
      A list of cart item Adjustments.
    • setFulfillmentGroupAdjustments

      public void setFulfillmentGroupAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentGroupAdjustments)
      A list of fulfillment group Adjustments.
    • setFulfillmentItemAdjustments

      public void setFulfillmentItemAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> fulfillmentItemAdjustments)
      A list of fulfillment item Adjustments.
    • setCart

      public void setCart(Cart cart)
    • toString

      public String toString()
      Overrides:
      toString in class Cart
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Cart
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Cart
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Cart
    • getQuantity

      public int getQuantity()
      Description copied from class: Cart
      Returns the sum of the quantities of all the Cart.cartItems.
      Overrides:
      getQuantity in class Cart
      Returns:
      the sum of the quantities of all the Cart.cartItems.
    • isAnonymous

      public boolean isAnonymous()
      Description copied from class: Cart
      Returns whether or not the cart is for an anonymous user.
      Overrides:
      isAnonymous in class Cart
      Returns:
      whether or not the cart is for an anonymous user.
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currencyUnit)
      Specified by:
      setCurrency in interface com.broadleafcommerce.money.CurrencyConsumer
      Overrides:
      setCurrency in class Cart
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      Specified by:
      getCurrency in interface javax.money.CurrencySupplier
      Overrides:
      getCurrency in class Cart
    • getCartItemsWithDependentItems

      public List<CartItem> getCartItemsWithDependentItems()
      Overrides:
      getCartItemsWithDependentItems in class Cart
    • getRecurringSubtotals

      public Map<String,javax.money.MonetaryAmount> getRecurringSubtotals()
      Description copied from class: Cart
      The estimated recurring subtotal for the first period discounted for all items grouped by their recurring period type.
      Overrides:
      getRecurringSubtotals in class Cart
    • getRecurringAdjustmentsTotals

      public Map<String,javax.money.MonetaryAmount> getRecurringAdjustmentsTotals()
      Description copied from class: Cart
      The estimated recurring adjustments total for the first period discounted for all items grouped by their recurring period type.
      Overrides:
      getRecurringAdjustmentsTotals in class Cart
    • getRecurringTotals

      public Map<String,javax.money.MonetaryAmount> getRecurringTotals()
      Description copied from class: Cart
      The estimated recurring total for the first period discounted for all items grouped by their recurring period type.
      Overrides:
      getRecurringTotals in class Cart
    • getId

      public String getId()
      Description copied from class: Cart
      The context ID of the cart.
      Overrides:
      getId in class Cart
      Returns:
      the context ID of the cart
    • getName

      public String getName()
      Description copied from class: Cart
      A unique name for the cart, used for retrieval. This field is not displayed anywhere.
      Overrides:
      getName in class Cart
      Returns:
      a unique name for the cart, used for retrieval
    • getType

      public String getType()
      Description copied from class: Cart
      The type of cart.
      Overrides:
      getType in class Cart
      See Also:
    • getStatus

      public String getStatus()
      Description copied from class: Cart
      The status of this cart.
      Overrides:
      getStatus in class Cart
      Returns:
      The status of this cart.
      See Also:
    • getCustomerRef

      public com.broadleafcommerce.order.common.domain.CustomerRef getCustomerRef()
      Description copied from class: Cart
      A reference to the customer that owns this cart.
      Overrides:
      getCustomerRef in class Cart
      Returns:
      A reference to the customer that owns this cart.
    • getApprovalRequestedDate

      public Instant getApprovalRequestedDate()
      Description copied from class: Cart
      The 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:
      getApprovalRequestedDate in class Cart
    • getApproverEmail

      public String getApproverEmail()
      Description copied from class: Cart
      The 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:
      getApproverEmail in class Cart
      Returns:
      The cart approver's email address.
    • getEmailAddress

      public String getEmailAddress()
      Description copied from class: Cart
      The customer's email address.
      Overrides:
      getEmailAddress in class Cart
      Returns:
      The customer's email address.
    • getOrderNumber

      public String getOrderNumber()
      Description copied from class: Cart
      The unique number associated with this Cart. Typically, this is generated and set on cart submission. Used for record keeping and communicating with the customer instead of just using Cart.getId() since that exposes unwanted information about your database.
      Overrides:
      getOrderNumber in class Cart
      Returns:
      The unique number associated with this Cart.
    • getCreateDate

      public Instant getCreateDate()
      Description copied from class: Cart
      The date that this cart was first created.
      Overrides:
      getCreateDate in class Cart
      Returns:
      The date that this cart was first created.
    • getSubmitDate

      public Instant getSubmitDate()
      Description copied from class: Cart
      The date that this cart was submitted. Only set if the cart status is DefaultCartStatuses.SUBMITTED, otherwise null.
      Overrides:
      getSubmitDate in class Cart
      Returns:
      The date that this cart was submitted.
      See Also:
    • getLocale

      public Locale getLocale()
      Description copied from class: Cart
      The locale for this cart. Used to determine what locale this cart was in for translations and other location-based functionality.
      Overrides:
      getLocale in class Cart
      Returns:
      The locale code for this cart.
    • getCartPricing

      public CartPricing getCartPricing()
      Description copied from class: Cart
      Embedded container for all pricing information on this cart.
      Overrides:
      getCartPricing in class Cart
      Returns:
      Embedded container for all pricing information on this cart.
    • getCartItems

      public List<CartItem> getCartItems()
      Description copied from class: Cart
      Items that are contained within this cart. Typically represents a good or service that the customer is purchasing.
      Overrides:
      getCartItems in class Cart
      Returns:
      Items for purchase that are contained within this cart.
    • getFulfillmentGroups

      public List<FulfillmentGroup> getFulfillmentGroups()
      Description copied from class: Cart
      A 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:
      getFulfillmentGroups in class Cart
      Returns:
      A list of fulfillment information for this cart.
    • getAdjustments

      public List<com.broadleafcommerce.order.common.domain.Adjustment> getAdjustments()
      Description copied from class: Cart
      Adjustments to order pricing that should be applied to CartPricing.getSubtotal().
      Overrides:
      getAdjustments in class Cart
      Returns:
      Adjustments to order pricing that should be applied to CartPricing.getSubtotal().
    • getOfferCodes

      public List<String> getOfferCodes()
      Description copied from class: Cart
      A list of offer codes that a user has added to their cart. Can be used to apply Adjustments to different aspects of the order.
      Overrides:
      getOfferCodes in class Cart
      Returns:
      A list of offer codes that a user has added to their cart.
    • getVouchers

      public List<com.broadleafcommerce.order.common.domain.Voucher> getVouchers()
      Description copied from class: Cart
      A list of Vouchers that this Cart is qualifier for.

      This mainly serves as a temporary storage and for UI display, the Vouchers will not be processed until the order is completed.

      Overrides:
      getVouchers in class Cart
    • getCampaignRefs

      public List<com.broadleafcommerce.order.common.domain.CampaignRef> getCampaignRefs()
      Description copied from class: Cart
      A list of campaign references that are attached to this cart. Similar to Cart.getOfferCodes(), the CampaignRef.getCampaignTrackingId() can be used to apply Adjustments to 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:
      getCampaignRefs in class Cart
      Returns:
      A list of campaign references that are attached to this cart.
    • getAssignedSalesRepId

      public String getAssignedSalesRepId()
      Description copied from class: Cart
      The id of the assigned sales rep.

      This is field is only used for quotes for the sales rep review process.

      Overrides:
      getAssignedSalesRepId in class Cart
    • getAssignedSalesRepEmail

      public String getAssignedSalesRepEmail()
      Description copied from class: Cart
      The email of the assigned sales rep.

      This is field is only used for quotes for the sales rep review process.

      Overrides:
      getAssignedSalesRepEmail in class Cart
    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from class: Cart
      Miscellaneous attributes for this cart.
      Overrides:
      getAttributes in class Cart
      Returns:
      Miscellaneous attributes for this cart.
    • getInternalAttributes

      public Map<String,Object> getInternalAttributes()
      Description copied from class: Cart
      Miscellaneous internal attributes for this item. Distinguished from Cart.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:
      getInternalAttributes in class Cart
      Returns:
      Miscellaneous internal attributes for this item.
    • getAttributeChoices

      public Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> getAttributeChoices()
      Description copied from class: Cart
      Attribute choices for this cart driven by its items' product options, where each key is the attributeName from an attribute choice.
      Overrides:
      getAttributeChoices in class Cart
      Returns:
      Attribute choices for this cart driven by its items' product options, where each key is the attributeName from an attribute choice.
    • getCheckoutSubmissions

      public Map<String,Instant> getCheckoutSubmissions()
      Description copied from class: Cart
      The checkout submissions made for this cart where each key is the request ID of a checkout and the value is an Instant timestamp of when the checkout was made.
      Overrides:
      getCheckoutSubmissions in class Cart
      Returns:
      The checkout submissions made for this cart where each key is the request ID and the value is an Instant timestamp of when the checkout was made.
    • isPriced

      public boolean isPriced()
      Description copied from class: Cart
      Flag to indicate whether this cart has been fully priced. This means totalling of items, adjustments, shipping and tax.
      Overrides:
      isPriced in class Cart
      Returns:
      Flag to indicate whether this cart has been fully priced.
    • isTaxEstimated

      public boolean isTaxEstimated()
      Description copied from class: Cart
      Flag to indicate whether the taxes on the cart are estimates.
      Overrides:
      isTaxEstimated in class Cart
      Returns:
      Flag to indicate whether the taxes on the cart are estimates.
    • getVersion

      public Integer getVersion()
      Description copied from class: Cart
      The 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:
      getVersion in class Cart
    • getCartAlerts

      public List<CartAlert> getCartAlerts()
      Description copied from class: Cart
      The list of the alerts for this Cart. NOTE: This is a transient property that is not persisted in the database.
      Overrides:
      getCartAlerts in class Cart
      Returns:
      the list of the cart alerts
    • getLastCatalogReprice

      public Instant getLastCatalogReprice()
      Description copied from class: Cart
      The last time the cart was fully repriced with the most updated catalog pricing.
      Overrides:
      getLastCatalogReprice in class Cart
      Returns:
      The last time the cart was fully repriced with the most updated catalog pricing.
    • getExpirationDate

      public Instant getExpirationDate()
      Description copied from class: Cart
      The expiration date of the cart. This is typically only used for DefaultCartTypes.QUOTE-typed carts.
      Overrides:
      getExpirationDate in class Cart
    • getLastUpdatedAudit

      public CartActionAudit getLastUpdatedAudit()
      Description copied from class: Cart
      The id of this cart's most recent audit.
      Overrides:
      getLastUpdatedAudit in class Cart
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      Description copied from class: Cart
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Overrides:
      getContextState in class Cart
      Returns:
      a subset of Tracking information to expose the context state for this object
    • setId

      public void setId(String id)
      Description copied from class: Cart
      The context ID of the cart.
      Overrides:
      setId in class Cart
      Parameters:
      id - the context ID of the cart
    • setName

      public void setName(String name)
      Description copied from class: Cart
      A unique name for the cart, used for retrieval. This field is not displayed anywhere.
      Overrides:
      setName in class Cart
      Parameters:
      name - a unique name for the cart, used for retrieval
    • setType

      public void setType(String type)
      Description copied from class: Cart
      The type of cart.
      Overrides:
      setType in class Cart
      See Also:
    • setStatus

      public void setStatus(String status)
      Description copied from class: Cart
      The status of this cart.
      Overrides:
      setStatus in class Cart
      Parameters:
      status - The status of this cart.
      See Also:
    • setCustomerRef

      public void setCustomerRef(com.broadleafcommerce.order.common.domain.CustomerRef customerRef)
      Description copied from class: Cart
      A reference to the customer that owns this cart.
      Overrides:
      setCustomerRef in class Cart
      Parameters:
      customerRef - A reference to the customer that owns this cart.
    • setApprovalRequestedDate

      public void setApprovalRequestedDate(Instant approvalRequestedDate)
      Description copied from class: Cart
      The 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:
      setApprovalRequestedDate in class Cart
    • setApproverEmail

      public void setApproverEmail(String approverEmail)
      Description copied from class: Cart
      The 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:
      setApproverEmail in class Cart
      Parameters:
      approverEmail - The cart approver's email address.
    • setEmailAddress

      public void setEmailAddress(String emailAddress)
      Description copied from class: Cart
      The customer's email address.
      Overrides:
      setEmailAddress in class Cart
      Parameters:
      emailAddress - The customer's email address.
    • setOrderNumber

      public void setOrderNumber(String orderNumber)
      Description copied from class: Cart
      The unique number associated with this Cart. Typically, this is generated and set on cart submission. Used for record keeping and communicating with the customer instead of just using Cart.getId() since that exposes unwanted information about your database.
      Overrides:
      setOrderNumber in class Cart
      Parameters:
      orderNumber - The unique number associated with this Cart.
    • setCreateDate

      public void setCreateDate(Instant createDate)
      Description copied from class: Cart
      The date that this cart was first created.
      Overrides:
      setCreateDate in class Cart
      Parameters:
      createDate - The date that this cart was first created.
    • setSubmitDate

      public void setSubmitDate(Instant submitDate)
      Description copied from class: Cart
      The date that this cart was submitted. Only set if the cart status is DefaultCartStatuses.SUBMITTED, otherwise null.
      Overrides:
      setSubmitDate in class Cart
      Parameters:
      submitDate - The date that this cart was submitted.
      See Also:
    • setLocale

      public void setLocale(Locale locale)
      Description copied from class: Cart
      The locale for this cart. Used to determine what locale this cart was in for translations and other location-based functionality.
      Overrides:
      setLocale in class Cart
      Parameters:
      locale - The locale code for this cart.
    • setCartPricing

      public void setCartPricing(CartPricing cartPricing)
      Description copied from class: Cart
      Embedded container for all pricing information on this cart.
      Overrides:
      setCartPricing in class Cart
      Parameters:
      cartPricing - Embedded container for all pricing information on this cart.
    • setCartItems

      public void setCartItems(List<CartItem> cartItems)
      Description copied from class: Cart
      Items that are contained within this cart. Typically represents a good or service that the customer is purchasing.
      Overrides:
      setCartItems in class Cart
      Parameters:
      cartItems - Items for purchase that are contained within this cart.
    • setFulfillmentGroups

      public void setFulfillmentGroups(List<FulfillmentGroup> fulfillmentGroups)
      Description copied from class: Cart
      A 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:
      setFulfillmentGroups in class Cart
      Parameters:
      fulfillmentGroups - A list of fulfillment information for this cart.
    • setAdjustments

      public void setAdjustments(List<com.broadleafcommerce.order.common.domain.Adjustment> adjustments)
      Description copied from class: Cart
      Adjustments to order pricing that should be applied to CartPricing.getSubtotal().
      Overrides:
      setAdjustments in class Cart
      Parameters:
      adjustments - Adjustments to order pricing that should be applied to CartPricing.getSubtotal().
    • setOfferCodes

      public void setOfferCodes(List<String> offerCodes)
      Description copied from class: Cart
      A list of offer codes that a user has added to their cart. Can be used to apply Adjustments to different aspects of the order.
      Overrides:
      setOfferCodes in class Cart
      Parameters:
      offerCodes - A list of offer codes that a user has added to their cart.
    • setVouchers

      public void setVouchers(List<com.broadleafcommerce.order.common.domain.Voucher> vouchers)
      Description copied from class: Cart
      A list of Vouchers that this Cart is qualifier for.

      This mainly serves as a temporary storage and for UI display, the Vouchers will not be processed until the order is completed.

      Overrides:
      setVouchers in class Cart
    • setCampaignRefs

      public void setCampaignRefs(List<com.broadleafcommerce.order.common.domain.CampaignRef> campaignRefs)
      Description copied from class: Cart
      A list of campaign references that are attached to this cart. Similar to Cart.getOfferCodes(), the CampaignRef.getCampaignTrackingId() can be used to apply Adjustments to 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:
      setCampaignRefs in class Cart
      Parameters:
      campaignRefs - A list of campaign references that are attached to this cart.
    • setAssignedSalesRepId

      public void setAssignedSalesRepId(String assignedSalesRepId)
      Description copied from class: Cart
      The id of the assigned sales rep.

      This is field is only used for quotes for the sales rep review process.

      Overrides:
      setAssignedSalesRepId in class Cart
    • setAssignedSalesRepEmail

      public void setAssignedSalesRepEmail(String assignedSalesRepEmail)
      Description copied from class: Cart
      The email of the assigned sales rep.

      This is field is only used for quotes for the sales rep review process.

      Overrides:
      setAssignedSalesRepEmail in class Cart
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Description copied from class: Cart
      Miscellaneous attributes for this cart.
      Overrides:
      setAttributes in class Cart
      Parameters:
      attributes - Miscellaneous attributes for this cart.
    • setInternalAttributes

      public void setInternalAttributes(Map<String,Object> internalAttributes)
      Description copied from class: Cart
      Miscellaneous internal attributes for this item. Distinguished from Cart.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:
      setInternalAttributes in class Cart
      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: Cart
      Attribute choices for this cart driven by its items' product options, where each key is the attributeName from an attribute choice.
      Overrides:
      setAttributeChoices in class Cart
      Parameters:
      attributeChoices - Attribute choices for this cart driven by its items' product options, where each key is the attributeName from an attribute choice.
    • setCheckoutSubmissions

      public void setCheckoutSubmissions(Map<String,Instant> checkoutSubmissions)
      Description copied from class: Cart
      The checkout submissions made for this cart where each key is the request ID of a checkout and the value is an Instant timestamp of when the checkout was made.
      Overrides:
      setCheckoutSubmissions in class Cart
      Parameters:
      checkoutSubmissions - The checkout submissions made for this cart where each key is the request ID of a checkout and the value is an Instant timestamp of when the checkout was made.
    • setPriced

      public void setPriced(boolean isPriced)
      Description copied from class: Cart
      Flag to indicate whether this cart has been fully priced. This means totalling of items, adjustments, shipping and tax.
      Overrides:
      setPriced in class Cart
      Parameters:
      isPriced - Flag to indicate whether this cart has been fully priced.
    • setTaxEstimated

      public void setTaxEstimated(boolean isTaxEstimated)
      Description copied from class: Cart
      Flag to indicate whether the taxes on the cart are estimates.
      Overrides:
      setTaxEstimated in class Cart
      Parameters:
      isTaxEstimated - Flag to indicate whether the taxes on the cart are estimates.
    • setVersion

      public void setVersion(Integer version)
      Description copied from class: Cart
      The 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:
      setVersion in class Cart
    • setCartAlerts

      public void setCartAlerts(List<CartAlert> cartAlerts)
      Description copied from class: Cart
      The list of the alerts for this Cart. NOTE: This is a transient property that is not persisted in the database.
      Overrides:
      setCartAlerts in class Cart
      Parameters:
      cartAlerts - the list of the cart alerts
    • setLastCatalogReprice

      public void setLastCatalogReprice(Instant lastCatalogReprice)
      Description copied from class: Cart
      The last time the cart was fully repriced with the most updated catalog pricing.
      Overrides:
      setLastCatalogReprice in class Cart
      Parameters:
      lastCatalogReprice - The last time the cart was fully repriced with the most updated catalog pricing.
    • setExpirationDate

      public void setExpirationDate(Instant expirationDate)
      Description copied from class: Cart
      The expiration date of the cart. This is typically only used for DefaultCartTypes.QUOTE-typed carts.
      Overrides:
      setExpirationDate in class Cart
    • setLastUpdatedAudit

      public void setLastUpdatedAudit(CartActionAudit lastUpdatedAudit)
      Description copied from class: Cart
      The id of this cart's most recent audit.
      Overrides:
      setLastUpdatedAudit in class Cart
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      Description copied from class: Cart
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Overrides:
      setContextState in class Cart
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object