Class FulfillmentPricingServiceImpl
java.lang.Object
org.broadleafcommerce.core.pricing.service.FulfillmentPricingServiceImpl
- All Implemented Interfaces:
FulfillmentPricingService
@Service("blFulfillmentPricingService")
public class FulfillmentPricingServiceImpl
extends Object
implements FulfillmentPricingService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FulfillmentGroupServiceprotected static final org.apache.commons.logging.Logprotected List<FulfillmentPricingProvider> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup) Called during the Pricing workflow to determine the cost for theFulfillmentGroup.estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options) This provides an estimation for aFulfillmentGroupwith aFulfillmentOption.voidsetProviders(List<FulfillmentPricingProvider> providers)
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
providers
-
fulfillmentGroupService
-
-
Constructor Details
-
FulfillmentPricingServiceImpl
public FulfillmentPricingServiceImpl()
-
-
Method Details
-
calculateCostForFulfillmentGroup
public FulfillmentGroup calculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup) throws FulfillmentPriceException Description copied from interface:FulfillmentPricingServiceCalled during the Pricing workflow to determine the cost for theFulfillmentGroup. This will loop through#getProcessors()and callFulfillmentPricingProvider.calculateCostForFulfillmentGroup(FulfillmentGroup)on the first processor that returns true fromFulfillmentPricingProvider#canCalculateCostForFulfillmentGroup(FulfillmentGroup)- Specified by:
calculateCostForFulfillmentGroupin interfaceFulfillmentPricingService- 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
-
estimateCostForFulfillmentGroup
public FulfillmentEstimationResponse estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options) throws FulfillmentPriceException Description copied from interface:FulfillmentPricingServiceThis provides an estimation for aFulfillmentGroupwith aFulfillmentOption. The main use case for this method is in a view cart controller that wants to provide estimations for differentFulfillmentOptions before the user actually selects one. This usesFulfillmentPricingService.getProviders()to allow third-party integrations to respond to estimations, and returns the first processor that returns true fromFulfillmentPricingProvider.canCalculateCostForFulfillmentGroup(FulfillmentGroup, FulfillmentOption).- Specified by:
estimateCostForFulfillmentGroupin interfaceFulfillmentPricingService- Returns:
- the price estimation for a particular
FulfillmentGroupwith a candidateFulfillmentOption - Throws:
FulfillmentPriceException- if no processor was found to estimate costs for fulfillmentGroup with the given option
-
getProviders
- Specified by:
getProvidersin interfaceFulfillmentPricingService
-
setProviders
-