|
|||||||||
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.DiscountCalculatorService atg.commerce.pricing.ShippingDiscountCalculator
public class ShippingDiscountCalculator
Calculates ShippingPriceInfos for ShippingGroups which the calculator is given.
This calculator can either be passed in a MatchingObject via the extra parameters map with key Constants.MATCHING_OBJECT
containing the ShippingGroup that qualified for the promotion
or it can consult the Qualifier service, looking for the ShippingGroup to be priced.
It calls Qualifier.findQualifyingShipping
for this purpose. If it gets back a ShippingGroup,
a ShippingPriceInfo is computed based on the input PricingModel (RepositoryItem).
If it obtains an ShippingGroup that qualified then it can determine the discount either via a DiscountStructure object being
passed into the calculator via the extra parameters map with key Constants.DISCOUNT_STRUCTURE or by getting the
discountType
and adjuster
properties of the input PricingModel (RepositoryItem).
Qualifier
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.commerce.pricing.DiscountCalculatorService |
---|
AMOUNT_INCREASE_TYPE, AMOUNT_OFF_TYPE, FIXED_PRICE_TYPE, ILLEGAL_TYPE, mPromotionTools, PERCENT_OFF_TYPE |
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 | |
---|---|
ShippingDiscountCalculator()
|
Method Summary | |
---|---|
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
protected double |
getAmountToDiscount(Order pOrder,
ShippingPriceInfo pPriceQuote,
ShippingGroup pShippingGroup,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This will return the amount that will eventually be discounted. |
void |
getAvailableMethods(java.util.List pMethods,
ShippingGroup pShipment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Get shipping methods available to deliver the shipping group. |
PricingTools |
getPricingTools()
pricing tools to help with generating prices |
void |
priceShippingGroup(Order pOrder,
ShippingPriceInfo pPriceQuote,
ShippingGroup pShipment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price a shipment within a context |
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with generating prices |
Methods inherited from class atg.commerce.pricing.DiscountCalculatorService |
---|
adjust, adjustAmount, getAdjuster, getDiscountType, getDiscountType, getPricingModelProperties, getPromotionTools, getQualifierService, getQualifierService, isNegativeAmountException, setNegativeAmountException, setPricingModelProperties, setPromotionTools, setQualifierService |
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 ShippingDiscountCalculator()
Method Detail |
---|
public void setPricingTools(PricingTools pPricingTools)
pPricingTools
- new value to setpublic PricingTools getPricingTools()
public void priceShippingGroup(Order pOrder, ShippingPriceInfo pPriceQuote, ShippingGroup pShipment, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceShippingGroup
in interface ShippingPricingCalculator
pOrder
- the Order in the context of which pShipment is being priced.pPriceQuote
- ShippingPriceInfo representing the price quote for the shipmentpShipment
- The shipment to pricepPricingModels
- A Collection of RepositoryItems representing PricingModelspProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
public void getAvailableMethods(java.util.List pMethods, ShippingGroup pShipment, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
getAvailableMethods
in interface ShippingPricingCalculator
pMethods
- List of Strings representing shipping methodspShipment
- The shipping group to deliverpPricingModels
- A Collection of RepositoryItems representing PricingModelspProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
protected double getAmountToDiscount(Order pOrder, ShippingPriceInfo pPriceQuote, ShippingGroup pShippingGroup, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- The order containing the shipping grouppPriceQuote
- ShippingPriceInfo representing the current price quote for the shipping grouppShippingGroup
- The shipping group that will be discounted (ignored by default)pPricingModel
- A RepositoryItems representing a PricingModel (ignored by default)pProfile
- The user's profile (ignored by default)pExtraParameters
- A Map of extra parameters to be used in the pricing, may be null (ignored by default)
PricingException
public void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |