com.konakart.bl.modules.ordertotal.totaldiscount
Class TotalDiscount
java.lang.Object
com.konakart.bl.modules.BaseModule
com.konakart.bl.modules.ordertotal.BaseOrderTotalModule
com.konakart.bl.modules.ordertotal.totaldiscount.TotalDiscount
- All Implemented Interfaces:
- OrderTotalInterface
public class TotalDiscount
- extends BaseOrderTotalModule
- implements OrderTotalInterface
Module that creates an OrderTotal object for applying a percentage discount or an amount discount
on the order. The discount may be applied on the total value of the order before or after tax.
The promotion may be activated only if:
- The total amount of the order is greater than a minimum amount
- The total number of products ordered is greater than a minimum amount
- The total number of a single product ordered is greater than a minimum amount
There may be multiple valid promotions applicable for an order. If this is the case, the logic
applied is the following: All cumulative promotions are summed into one order total object. Then
we loop through the order total objects and choose the one that offers the largest discount.
|
Method Summary |
java.lang.String |
getCode()
|
com.konakart.app.OrderTotal |
getOrderTotal(com.konakart.app.Order order,
boolean dispPriceWithTax,
java.util.Locale locale)
Create and return an OrderTotal object for the discount amount. |
int |
getSortOrder()
|
boolean |
isAvailable()
Returns true or false |
void |
setStaticVariables()
Sets some static variables during setup |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TotalDiscount
public TotalDiscount()
throws org.apache.torque.TorqueException,
com.konakart.app.KKException,
com.workingdogs.village.DataSetException
- Constructor
- Throws:
com.workingdogs.village.DataSetException
com.konakart.app.KKException
org.apache.torque.TorqueException
setStaticVariables
public void setStaticVariables()
throws com.konakart.app.KKException
- Sets some static variables during setup
- Specified by:
setStaticVariables in interface OrderTotalInterface
- Throws:
com.konakart.app.KKException
isAvailable
public boolean isAvailable()
throws com.konakart.app.KKException
- Returns true or false
- Specified by:
isAvailable in interface OrderTotalInterface
- Returns:
- True or False
- Throws:
com.konakart.app.KKException
getOrderTotal
public com.konakart.app.OrderTotal getOrderTotal(com.konakart.app.Order order,
boolean dispPriceWithTax,
java.util.Locale locale)
throws java.lang.Exception
- Create and return an OrderTotal object for the discount amount.
- Specified by:
getOrderTotal in interface OrderTotalInterface
- Parameters:
order - dispPriceWithTax - locale -
- Returns:
- Returns an OrderTotal object for this module
- Throws:
java.lang.Exception
getSortOrder
public int getSortOrder()
- Specified by:
getSortOrder in interface OrderTotalInterface
- Returns:
- Return the order in which the module gets called and displayed
getCode
public java.lang.String getCode()
- Specified by:
getCode in interface OrderTotalInterface
- Returns:
- Returns the code for the module
Copyright © 2006 DS Data Systems UK Ltd.