Interface FulfillmentOption
- All Superinterfaces:
org.broadleafcommerce.common.copy.MultiTenantCloneable<FulfillmentOption>,Serializable
- All Known Subinterfaces:
BandedPriceFulfillmentOption,BandedWeightFulfillmentOption,FixedPriceFulfillmentOption
- All Known Implementing Classes:
BandedPriceFulfillmentOptionImpl,BandedWeightFulfillmentOptionImpl,FixedPriceFulfillmentOptionImpl,FulfillmentOptionImpl
public interface FulfillmentOption
extends Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<FulfillmentOption>
A FulfillmentOption is used to hold information about a particular type of Fulfillment implementation.
Third-party fulfillment implementations should extend this to provide their own configuration options
particular to that implementation. For instance, a UPS shipping calculator might want an admin user to be
able to specify which type of UPS shipping this FulfillmentOption represents.
This entity will be presented to the user to allow them to specify which shipping they want. A possible scenario is that say a site can ship with both UPS and Fedex. They will import both the Fedex and UPS third-party modules, each of which will have a unique definition of FulfillmentOption (for instance, FedexFulfillmentOption and UPSFulfillmentOption). Let's say the site can do 2-day shipping with UPS, and next-day shipping with Fedex. What they would do in the admin is create an instance of FedexFulfillmentOption entity and give it the name "Overnight" (along with any needed Fedex configuration properties), then create an instance of UPSFulfillmentOption and give it the name "2 Day". When the user goes to check out, they will then see a list with "Overnight" and "2 day" in it. A FulfillmentPricingProvider can then be used to estimate the fulfillment cost (and calculate the fulfillment cost) for that particular option.
FulfillmentOptions are also inherently related to FulfillmentProcessors, in that specific types of FulfillmentOption implementations should also have a FulfillmentPricingProvider that can handle operations (estimation and calculation) for pricing a FulfillmentGroup. Typical third-party implementations of this paradigm would have a 1 FulfillmentOption entity implementation and 1 FulfillmentPricingProvider implementation for that particular service.
This entity will be presented to the user to allow them to specify which shipping they want. A possible scenario is that say a site can ship with both UPS and Fedex. They will import both the Fedex and UPS third-party modules, each of which will have a unique definition of FulfillmentOption (for instance, FedexFulfillmentOption and UPSFulfillmentOption). Let's say the site can do 2-day shipping with UPS, and next-day shipping with Fedex. What they would do in the admin is create an instance of FedexFulfillmentOption entity and give it the name "Overnight" (along with any needed Fedex configuration properties), then create an instance of UPSFulfillmentOption and give it the name "2 Day". When the user goes to check out, they will then see a list with "Overnight" and "2 day" in it. A FulfillmentPricingProvider can then be used to estimate the fulfillment cost (and calculate the fulfillment cost) for that particular option.
FulfillmentOptions are also inherently related to FulfillmentProcessors, in that specific types of FulfillmentOption implementations should also have a FulfillmentPricingProvider that can handle operations (estimation and calculation) for pricing a FulfillmentGroup. Typical third-party implementations of this paradigm would have a 1 FulfillmentOption entity implementation and 1 FulfillmentPricingProvider implementation for that particular service.
Note: even though the default Broadleaf implementation of this is non-abstract (FulfillmentOptionImpl),
it is very rare that you would actually want to instantiate a raw FulfillmentOptionImpl rather than using
a subclass of this.
- Author:
- Phillip Verheyden
-
Method Summary
Modifier and TypeMethodDescriptionGets the type of fulfillment that this option supportsgetId()Gets the long description for this option which can be shown to the user to provide more information about the option they are selecting.getName()Gets the name displayed to the user when they selected the FulfillmentOption for their order.Returns if option is taxableReturns taxCode of optionTells theFulfillmentPricingProviderwhether it should try to use the flat rate cost for aSkurather than try to factor thatSkuinto its shipping calculation.voidsetFulfillmentType(FulfillmentType fulfillmentType) Sets the type of fulfillment that this option supportsvoidvoidsetLongDescription(String longDescription) Sets the long description for this option to show to the user when they select an option for fulfilling their ordervoidSet the display name for this option that will be shown to the user to select from such as "2-day" or "Express" or "Super-saver shipping"voidsetTaxable(Boolean taxable) Sets taxability of optionvoidsetTaxCode(String taxCode) Sets the taxCode of the particular optionvoidsetUseFlatRates(Boolean useFlatRates) Tells theFulfillmentPricingProviderwhether it should try to use the flat rate cost for aSkurather than try to factor thatSkuinto its shipping calculationMethods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstance
-
Method Details
-
getId
Long getId() -
setId
-
getName
String getName()Gets the name displayed to the user when they selected the FulfillmentOption for their order. This might be "2-day" or "Super-saver shipping"- Returns:
- the display name for this option
-
setName
Set the display name for this option that will be shown to the user to select from such as "2-day" or "Express" or "Super-saver shipping"- Parameters:
name- - the display name for this option
-
getLongDescription
String getLongDescription()Gets the long description for this option which can be shown to the user to provide more information about the option they are selecting. An example might be that this is shipped the next business day or that it requires additional processing time- Returns:
- the description to display to the user
-
setLongDescription
Sets the long description for this option to show to the user when they select an option for fulfilling their order- Parameters:
longDescription- - the description to show to the user
-
getUseFlatRates
Boolean getUseFlatRates()Tells theFulfillmentPricingProviderwhether it should try to use the flat rate cost for aSkurather than try to factor thatSkuinto its shipping calculation. This defaults to true- Returns:
- true if the
FulfillmentPricingProvidershould use the flat rate on aSkuwhen it's available rather than try to calculate shipping for it, false otherwise. Default value is true
-
setUseFlatRates
Tells theFulfillmentPricingProviderwhether it should try to use the flat rate cost for aSkurather than try to factor thatSkuinto its shipping calculation- Parameters:
useFlatRates-
-
getFulfillmentType
FulfillmentType getFulfillmentType()Gets the type of fulfillment that this option supports- Returns:
- the type of this option
-
setFulfillmentType
Sets the type of fulfillment that this option supports- Parameters:
fulfillmentType-
-
getTaxCode
String getTaxCode()Returns taxCode of option- Returns:
-
setTaxCode
Sets the taxCode of the particular option- Parameters:
taxCode-
-
getTaxable
Boolean getTaxable()Returns if option is taxable- Returns:
-
setTaxable
Sets taxability of option- Parameters:
taxable-
-