public class WeightRangeShippingCalculator extends DoubleRangeShippingCalculator
addAmount
is true then instead of setting the price
quote amount to the value of the amount
property, the calculator adds
the amount to the current amount in the
price quote. This can be used to configure a "surcharge" calculator, which increases
the shipping price.
The shippingMethod
property should be set to the name of a particular
delivery process.
For example: UPS Ground, UPS 2-day or UPS Next Day.
If the ignoreShippingMethod
property is true, then this calculator does not
expose a shipping method name (through getAvailableMethods). In addition this calculator will
always attempt to perform pricing. This option is available if the user is not given a choice
of different shipping methods.
DoubleRangeShippingCalculator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
mAmounts, MAX_VALUE_KEY, mHighRanges, mLowRanges, TOKEN
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
WeightRangeShippingCalculator() |
Modifier and Type | Method and Description |
---|---|
OrderManager |
getOrderManager()
Return the OrderManager property.
|
protected double |
getQuantity(ShippingGroupCommerceItemRelationship pCommerceItemRelationship)
Get the quantity (with fraction) of a particular item that are being shipped by this
this shipping group.
|
protected double |
getRangeComparisonValue(Order pOrder,
ShippingGroup pShippingGroup)
Get the value that will be used in the range comparison.
|
protected double |
getRangeComparisonValue(ShippingGroup pShippingGroup)
Deprecated.
|
protected double |
getWeight(CommerceItem pCommerceItem)
Responsible for getting the weight associated with an instance of a commerce item.
|
java.lang.String |
getWeightProperty()
Return the weightProperty property.
|
protected double |
getWeightTotal(ShippingGroup pShippingGroup)
Calculate the total weight of the items being shipped to the
specified ShippingGroup.
|
void |
setOrderManager(OrderManager pOrderManager)
Set the OrderManager property.
|
void |
setWeightProperty(java.lang.String pWeightProperty)
Set the weightProperty property.
|
doStartService, getAmount, getRanges, initializeRanges, setRanges
getAmount, getAvailableMethods, getPricingTools, getShippingMethod, haveItemsToShip, isAddAmount, isIgnoreShippingMethod, performPricing, priceShippingGroup, priceShippingPriceInfo, priceShippingPriceInfo, resetShippingPriceInfo, setAddAmount, setIgnoreShippingMethod, setPricingTools, setShippingMethod
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public void setWeightProperty(java.lang.String pWeightProperty)
public java.lang.String getWeightProperty()
public void setOrderManager(OrderManager pOrderManager)
public OrderManager getOrderManager()
protected double getRangeComparisonValue(ShippingGroup pShippingGroup) throws PricingException
getRangeComparisonValue
in class DoubleRangeShippingCalculator
pShippingGroup
- the shipping groupPricingException
- if an error occursprotected double getRangeComparisonValue(Order pOrder, ShippingGroup pShippingGroup) throws PricingException
getRangeComparisonValue
in class DoubleRangeShippingCalculator
pShippingGroup
- the shipping groupPricingException
- if an error occursprotected double getWeightTotal(ShippingGroup pShippingGroup) throws PricingException
getWeight
is called to extract the weight for
each item.
pShippingGroup
- a value of type 'ShippingGroup'PricingException
protected double getWeight(CommerceItem pCommerceItem) throws PricingException
This method can be overriden if the weight is to be obtained from another location.
pCommerceItem
- the commerce item whose weight is to be extractedPricingException
protected double getQuantity(ShippingGroupCommerceItemRelationship pCommerceItemRelationship)
pCommerceItemRelationship
- a value of type 'CommerceItemRelationship'double