|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PromotionMgrIf
PromotionMgrIf Interface which an implementation of this manager must adhere to.
Method Summary | |
---|---|
int |
checkCoupon(java.lang.String couponCode)
This method is used to verify whether a coupon code actually exists and if it does, whether the coupon is still active. |
Promotion[] |
getAllPromotions()
Returns an array of all active promotions |
int |
getPromotionIdForGiftCertificate(OrderProductIf op)
Get the promotion id for an order product object containing a gift certificate. |
Promotion[] |
getPromotions(java.lang.String orderTotalCode,
Order order)
We return all active promotions for the orderTotalCode passed in as a parameter. |
ProductIf[] |
getPromotionsPerProducts(java.lang.String sessionId,
int customerId,
ProductIf[] products,
PromotionIf[] promotions,
java.lang.String[] couponCodes,
PromotionOptionsIf options)
This method is used to calculate a discount on individual products so that the discount can be displayed without having to add the product to the cart. The method receives an array of products and returns an array of products with attached PromotionResult objects that contain the results of one or more of the promotions passed in as a parameter. |
int |
insertCoupon(CouponIf coupon,
int promotionId)
Insert a coupon and associate it with the promotion referenced by promotionId. |
void |
refreshConfigs()
Refresh the configuration of the Promotion manager |
void |
updatePromotionUsage(Order order)
If the order has any associated coupons we iterate through the coupons and increment the timesUsed attribute. |
Method Detail |
---|
Promotion[] getPromotions(java.lang.String orderTotalCode, Order order) throws java.lang.Exception
orderTotalCode
- order
-
java.lang.Exception
void updatePromotionUsage(Order order) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
order
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
int getPromotionIdForGiftCertificate(OrderProductIf op) throws KKException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
op
-
KKException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
int insertCoupon(CouponIf coupon, int promotionId) throws java.lang.Exception
coupon
- promotionId
-
java.lang.Exception
int checkCoupon(java.lang.String couponCode) throws com.workingdogs.village.DataSetException, org.apache.torque.TorqueException
couponCode
- The coupon code
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
Promotion[] getAllPromotions() throws java.lang.Exception
java.lang.Exception
ProductIf[] getPromotionsPerProducts(java.lang.String sessionId, int customerId, ProductIf[] products, PromotionIf[] promotions, java.lang.String[] couponCodes, PromotionOptionsIf options) throws java.lang.Exception
sessionId
- Only used if the customer is logged in. Otherwise set to null.customerId
- If the sessionId is set to null then the customerId should contain the id of the
temporary user which is a negative number. The temporary user id can be used for
evaluating expression rules.products
- An array of products to be processedpromotions
- The promotions which will be applied to the products if all rules are matched.couponCodes
- Coupon codes to use. If none of the promotions require coupons, it should be set
to nulloptions
- An object containing information to configure the calculation for applying one or
more promotion results to the product price.
java.lang.Exception
void refreshConfigs() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |