Interface FulfillmentOptionRequestService

All Known Implementing Classes:
DefaultFulfillmentOptionRequestService

public interface FulfillmentOptionRequestService
  • Method Summary

    Modifier and Type
    Method
    Description
    calculateOptionsAndGroups(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.fulfillment.common.domain.Address address, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Convenience method to get all fulfillment options for an address and assign defaults.
    com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig
    fetchFulfillmentPriceConfig(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Fetch the FulfillmentPricingConfig from the FulfillmentProvider.
    com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse
    getFulfillmentOptionsForCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Fetch all available fulfillment options for the given cart.
    void
    refreshOptions(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Refresh the selected PricedFulfillmentOptions on the cart.
    submitFulfillmentOption(com.broadleafcommerce.order.common.domain.PricedFulfillmentOption pricedFulfillmentOption, com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Attach the given PricedFulfillmentOption to its target and then refresh options.
    updateFulfillmentGroupAddress(String referenceId, com.broadleafcommerce.fulfillment.common.domain.Address address, com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Update the Address of a FulfillmentGroup and refresh fulfillment options.
  • Method Details

    • getFulfillmentOptionsForCart

      com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse getFulfillmentOptionsForCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Fetch all available fulfillment options for the given cart.
      Parameters:
      cart - The cart to retrieve fulfillment options for.
      contextInfo - The context of the request.
      Returns:
      A FulfillmentOptionResponse with PricedFulfillmentOption for either each item or each group, depending on configuration.
    • calculateOptionsAndGroups

      CartFulfillmentResponse calculateOptionsAndGroups(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.fulfillment.common.domain.Address address, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Convenience method to get all fulfillment options for an address and assign defaults. The address argument is optional and will be applied to any FulfillmentGroups that do not already have an address.
      Parameters:
      cart - The cart to whose items or groups will be used to fetch fulfillment options.
      address - An optional Address to assign to any FulfillmentGroup that does not have an address already.
      contextInfo - The context of the request.
      Returns:
      A CartFulfillmentResponse that includes the available PricedFulfillmentOptions and an updated cart with default fulfillment options assigned to the targets.
    • submitFulfillmentOption

      CartFulfillmentResponse submitFulfillmentOption(com.broadleafcommerce.order.common.domain.PricedFulfillmentOption pricedFulfillmentOption, com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Attach the given PricedFulfillmentOption to its target and then refresh options.
      Parameters:
      pricedFulfillmentOption - The PricedFulfillmentOption that the user has selected.
      cart - The user's cart being operated on.
      contextInfo - The context of the request.
      Returns:
      A CartFulfillmentResponse that includes the available PricedFulfillmentOptions and an updated cart with selected fulfillment option assigned.
    • updateFulfillmentGroupAddress

      CartFulfillmentResponse updateFulfillmentGroupAddress(String referenceId, com.broadleafcommerce.fulfillment.common.domain.Address address, com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)

      Update the Address of a FulfillmentGroup and refresh fulfillment options.

      This method is intended for updating an Address outside the checkout flow, in order to get updated fulfillment options on a non-checkout page. Within a checkout flow, use CheckoutCartEndpoint#updateFulfillmentGroupInCart to ensure all the fields required for checkout are populated.

      Parameters:
      referenceId - The reference id of the FulfillmentGroup to update.
      address - The Address to assign to the indicated FulfillmentGroup.
      cart - The cart that contains the indicated FulfillmentGroup.
      contextInfo - The context of the request.
      Returns:
      A CartFulfillmentResponse that includes the available PricedFulfillmentOptions for the given address and an updated cart with valid fulfillment options assigned to the targets.
    • fetchFulfillmentPriceConfig

      com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig fetchFulfillmentPriceConfig(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Fetch the FulfillmentPricingConfig from the FulfillmentProvider.
      Parameters:
      contextInfo - The context of the request.
      Returns:
      The FulfillmentPricingConfig for the given context.
    • refreshOptions

      void refreshOptions(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)

      Refresh the selected PricedFulfillmentOptions on the cart. Up-to-date options will be retrieved from the FulfillmentProvider for the selected options on the cart.

      The selected PricedFulfillmentOptions on items and groups will be updated with an option that matches Fulfillment Type, Service Level, and Provider ID. If for any reason an exact match is not found, fallback logic will be used to determine an appropriate replacement.

      Parameters:
      cart - The cart whose fulfillment options should be refreshed.
      contextInfo - The context of the request.