public class FreeProduct extends BaseOrderTotalModule implements OrderTotalInterface
The SKU of the free product is saved in the Custom1 field of the Order Total. The id of the free product is saved in the Custom2 field of the Order Total.
The promotion may be activated only if:
manageFreeProductInventory()
.Modifier and Type | Class and Description |
---|---|
protected class |
FreeProduct.StaticData
Used to store the static data of this module
|
log, orderTotalList
basePackage, debugStackTraceExclusions
Constructor and Description |
---|
FreeProduct(KKEngIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCode() |
java.lang.String |
getModuleClassName()
Gets the name of the module class.
|
OrderTotal |
getOrderTotal(Order order,
boolean dispPriceWithTax,
java.util.Locale locale)
Create and return an OrderTotal object for the free product.
|
PromotionResult |
getPromotionResult(Product product,
Promotion promotion)
Returns an object containing the promotion discount.
|
int |
getSortOrder() |
boolean |
isAvailable()
Returns true or false
|
void |
setStaticVariables()
Sets some static variables during setup
|
addTax, commitOrder, getCustomBigDecimal, getCustomBoolean, getCustomInt, getCustomString, getDiscountOrderTotalFromList, getDiscountOrderTotalFromList, getOrderTotalList, getTaxForDiscount, getTaxFromTotal, removeCouponId, removePromotionId, removeTax, setCouponIds, setOrderTotalList, setPromotionIds, setRefundValues, setRefundValuesForSingleOrderTotal
getBasketMgr, getCatMgr, getConfigMgr, getConfiguration, getConfigurationValue, getConfigurationValueAsBigDecimalWithDefault, getConfigurationValueAsBool, getConfigurationValueAsIntWithDefault, getCurrMgr, getCustMgr, getCustTagMgr, getDebugStackTraceExclusions, getEmailMgr, getEng, getLangMgr, getMultiStoreMgr, getNewCriteria, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getRandomText, getRandomText, getResourceBundle, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getTaxMgr, getZoneCodeForZoneName, init, isAvailable, isAvailable, isMultiStoreShareCustomersOrProducts, setDebugStackTraceExclusions, updateStaticVariablesNow
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
commitOrder, getOrderTotalList, setOrderTotalList
public FreeProduct(KKEngIf eng) throws org.apache.torque.TorqueException, com.konakart.app.KKException, com.workingdogs.village.DataSetException
eng
- the KonaKart enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)com.konakart.app.KKException
- an unexpected exception from the KonaKart engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public void setStaticVariables() throws com.konakart.app.KKException
setStaticVariables
in interface OrderTotalInterface
com.konakart.app.KKException
- an unexpected exception from the KonaKart enginepublic boolean isAvailable() throws com.konakart.app.KKException
isAvailable
in interface OrderTotalInterface
com.konakart.app.KKException
- an unexpected exception from the KonaKart enginepublic OrderTotal getOrderTotal(Order order, boolean dispPriceWithTax, java.util.Locale locale) throws java.lang.Exception
getOrderTotal
in interface OrderTotalInterface
order
- the orderdispPriceWithTax
- the dispPriceWithTaxlocale
- the localejava.lang.Exception
- an unexpected exceptionpublic PromotionResult getPromotionResult(Product product, Promotion promotion) throws java.lang.Exception
value
attribute of the PromotionResult object.getPromotionResult
in interface OrderTotalInterface
getPromotionResult
in class BaseOrderTotalModule
product
- the productpromotion
- the promotionjava.lang.Exception
- an unexpected exceptionpublic int getSortOrder()
getSortOrder
in interface OrderTotalInterface
public java.lang.String getCode()
getCode
in interface OrderTotalInterface
public java.lang.String getModuleClassName()
BaseModule
getModuleClassName
in interface OrderTotalInterface
getModuleClassName
in class BaseModule
Copyright © 2018 DS Data Systems UK Ltd.