|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.pricing.ShippingCalculatorImpl atg.commerce.pricing.DoubleRangeShippingCalculator atg.commerce.pricing.WeightRangeShippingCalculator
public class WeightRangeShippingCalculator
This calculator will calculate shipping costs based upon the total weight of the items in a
shipping group. So, the total weight of a shipping group will be calculated, then the range of weight
values will be consulted to determine the cost.
If the property 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
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.commerce.pricing.DoubleRangeShippingCalculator |
---|
mAmounts, MAX_VALUE_KEY, mHighRanges, mLowRanges, TOKEN |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
WeightRangeShippingCalculator()
|
Method Summary | |
---|---|
OrderManager |
getOrderManager()
Return the OrderManager property. |
protected double |
getQuantity(ShippingGroupCommerceItemRelationship pCommerceItemRelationship)
Get the quantity 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. |
Methods inherited from class atg.commerce.pricing.DoubleRangeShippingCalculator |
---|
doStartService, getAmount, getRanges, initializeRanges, setRanges |
Methods inherited from class atg.commerce.pricing.ShippingCalculatorImpl |
---|
getAmount, getAvailableMethods, getPricingTools, getShippingMethod, haveItemsToShip, isAddAmount, isIgnoreShippingMethod, performPricing, priceShippingGroup, priceShippingPriceInfo, resetShippingPriceInfo, setAddAmount, setIgnoreShippingMethod, setPricingTools, setShippingMethod |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public WeightRangeShippingCalculator()
Method Detail |
---|
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 group
PricingException
- if an error occursprotected double getRangeComparisonValue(Order pOrder, ShippingGroup pShippingGroup) throws PricingException
getRangeComparisonValue
in class DoubleRangeShippingCalculator
pShippingGroup
- the shipping group
PricingException
- 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 extracted
PricingException
protected double getQuantity(ShippingGroupCommerceItemRelationship pCommerceItemRelationship)
pCommerceItemRelationship
- a value of type 'CommerceItemRelationship'
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |