public class OrderQualifyingTotalBasedPurchaseCondition extends java.lang.Object implements Condition
OrderQualifyingTotalBasedPurchaseCondition
sets out the
conditions of an exact or minimum order total value to a target of subtotal, tax,
shipping or shipping tax before the corresponding rewards can be calculated and
applied to an order. This implementation is intended for used in customization and is
not supported by default promotions.
The following is a sample XML representation of the
OrderQualifyingTotalBasedPurchaseCondition
:
<PurchaseCondition impl="com.ibm.commerce.marketing.promotion.condition.OrderQualifyingTotalBasedPurchaseCondition"> <!-- Options are: EXACT or MINIMUM --> <Qualifier>EXACT</Qualifier> <Amount>100</Amount> <Currency>CAD</Currency> <!-- One to four types of values or'd together, e.g. SUBTOTAL|TAX|SHIPPING|SHIPPING_TAX --> <Target>SUBTOTAL</Target> <!-- Reward is the same as any other reward object --> <Reward impl="com.ibm.commerce.marketing.promotion.reward.DefaultReward"> <AdjustmentFunction impl="com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction"> <FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain"> <Filter impl="com.ibm.commerce.marketing.promotion.condition.DummyFilter"/> </FilterChain> <Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment"> <AmountOff>15</AmountOff> <Currency>CAD</Currency> <AdjustmentType>wholeOrder</AdjustmentType> </Adjustment> </AdjustmentFunction> </Reward> </PurchaseCondition>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
static int |
EXACT
Targets exactly the amount of spending as specified in this purchase condition
|
static int |
MINIMUM
Targets minimum this amount of spending as specified in the purchase condition, up to the entire order
total
|
Constructor and Description |
---|
OrderQualifyingTotalBasedPurchaseCondition()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(PromotionContext context)
The evaluate method is used to determine if the condition has been
satisfied successfully.
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.math.BigDecimal |
getAmount()
Amount Getter.
|
java.lang.String |
getCurrency()
Currency Getter
|
int |
getMask()
Mask Getter.
|
int |
getQualifier()
Returns either EXACT or MINIMUM qualifier on the required amount in this purchase condition
|
Reward |
getReward()
Returns the reward associated with this condition
|
void |
setAmount(java.math.BigDecimal decimal)
Setter for amount
|
void |
setCurrency(java.lang.String string)
Setter for currency
|
void |
setMask(int i)
Sets for monetary value types bit pattern.
|
void |
setQualifier(int i)
Setter for qualifier: EXACT or MINIMUM
|
void |
setReward(Reward aReward)
Setter for the reward
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final int EXACT
public static final int MINIMUM
public OrderQualifyingTotalBasedPurchaseCondition()
public boolean evaluate(PromotionContext context) throws PromotionConditionEvaluationException
Condition
evaluate
in interface Condition
context
- The PromotionContext.PromotionConditionEvaluationException
- This exception is thrown if the evaluation encounters
unexpected problems.Condition.evaluate(com.ibm.commerce.marketing.promotion.runtime.PromotionContext)
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(org.w3c.dom.Node)
public java.math.BigDecimal getAmount()
public java.lang.String getCurrency()
public int getMask()
public Reward getReward()
public int getQualifier()
public void setAmount(java.math.BigDecimal decimal)
decimal
- amountpublic void setCurrency(java.lang.String string)
string
- currencypublic void setMask(int i)
i
- the bit patternpublic void setReward(Reward aReward)
aReward
- The rewardpublic void setQualifier(int i)
i
- The new qualifier