com.ibm.commerce.marketing.promotion.condition

Class OrderQualifyingTotalBasedPurchaseCondition

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.condition.OrderQualifyingTotalBasedPurchaseCondition
  • All Implemented Interfaces:
    Condition, XMLizable, java.io.Serializable


    public class OrderQualifyingTotalBasedPurchaseCondition
    extends java.lang.Object
    implements Condition
    The 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>
            
     
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright
        See Also:
        Constant Field Values
      • EXACT

        public static final int EXACT
        Targets exactly the amount of spending as specified in this purchase condition
        See Also:
        Constant Field Values
      • MINIMUM

        public static final int MINIMUM
        Targets minimum this amount of spending as specified in the purchase condition, up to the entire order total
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderQualifyingTotalBasedPurchaseCondition

        public OrderQualifyingTotalBasedPurchaseCondition()
        Constructor.
    • Method Detail

      • getAmount

        public java.math.BigDecimal getAmount()
        Amount Getter.
        Returns:
        amount
      • getCurrency

        public java.lang.String getCurrency()
        Currency Getter
        Returns:
        currency
      • getMask

        public int getMask()
        Mask Getter. Returns the bit mask of the types of monetary value we are targeting
        Returns:
        the types of monetary value this condition targets in a bit pattern.
      • getReward

        public Reward getReward()
        Returns the reward associated with this condition
        Returns:
        the reward
      • getQualifier

        public int getQualifier()
        Returns either EXACT or MINIMUM qualifier on the required amount in this purchase condition
        Returns:
        The qualifier
      • setAmount

        public void setAmount(java.math.BigDecimal decimal)
        Setter for amount
        Parameters:
        decimal - amount
      • setCurrency

        public void setCurrency(java.lang.String string)
        Setter for currency
        Parameters:
        string - currency
      • setMask

        public void setMask(int i)
        Sets for monetary value types bit pattern.
        Parameters:
        i - the bit pattern
      • setReward

        public void setReward(Reward aReward)
        Setter for the reward
        Parameters:
        aReward - The reward
      • setQualifier

        public void setQualifier(int i)
        Setter for qualifier: EXACT or MINIMUM
        Parameters:
        i - The new qualifier