org.broadleafcommerce.core.pricing.service
Interface FulfillmentPricingService

All Known Implementing Classes:
FulfillmentPricingServiceImpl

public interface FulfillmentPricingService

This service can be used in a couple of different ways. First, this is used in the pricing workflow and specifically FulfillmentGroupMerchandiseTotalActivity to calculate costs for FulfillmentGroups in an Order. This can also be injected in a controller to provide estimations for various FulfillmentOptions to display to the user before an option is actually selected.

Author:
Phillip Verheyden

Method Summary
 FulfillmentGroup calculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
          Called during the Pricing workflow to determine the cost for the FulfillmentGroup.
 FulfillmentEstimationResponse estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options)
          This provides an estimation for a FulfillmentGroup with a FulfillmentOption.
 List<FulfillmentPricingProvider> getProviders()
           
 

Method Detail

calculateCostForFulfillmentGroup

FulfillmentGroup calculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
                                                  throws FulfillmentPriceException
Called during the Pricing workflow to determine the cost for the FulfillmentGroup. This will loop through #getProcessors() and call FulfillmentPricingProvider.calculateCostForFulfillmentGroup(FulfillmentGroup) on the first processor that returns true from FulfillmentPricingProvider#canCalculateCostForFulfillmentGroup(FulfillmentGroup)

Parameters:
fulfillmentGroup -
Returns:
the updated fulfillmentGroup with its shippingPrice set
Throws:
FulfillmentPriceException - if fulfillmentGroup does not have a FulfillmentOption associated to it or if there was no processor found to calculate costs for fulfillmentGroup
See Also:
FulfillmentPricingProvider}

estimateCostForFulfillmentGroup

FulfillmentEstimationResponse estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup,
                                                              Set<FulfillmentOption> options)
                                                              throws FulfillmentPriceException
This provides an estimation for a FulfillmentGroup with a FulfillmentOption. The main use case for this method is in a view cart controller that wants to provide estimations for different FulfillmentOptions before the user actually selects one. This uses getProviders() to allow third-party integrations to respond to estimations, and returns the first processor that returns true from FulfillmentPricingProvider.canCalculateCostForFulfillmentGroup(FulfillmentGroup, FulfillmentOption).

Parameters:
fulfillmentGroup -
options -
Returns:
the price estimation for a particular FulfillmentGroup with a candidate FulfillmentOption
Throws:
FulfillmentPriceException - if no processor was found to estimate costs for fulfillmentGroup with the given option
See Also:
FulfillmentPricingProvider}

getProviders

List<FulfillmentPricingProvider> getProviders()


Copyright © 2013. All Rights Reserved.