[DEPRECATED] Script: Class dw.campaign.CampaignMgr
Class CampaignMgr
- Object
- dw.campaign.CampaignMgr
CampaignMgr provides static methods for managing campaign-specific operations such as accessing promotions or updating promotion line items.
Deprecated:
Use PromotionMgr instead.
Properties
applicablePromotions : Collection Read Only
The enabled promotions of active campaigns applicable for the current customer and source code.
Note that this method does not return any coupon-based promotions.
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getPromotions()
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
static applyBonusPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
This method has been deprecated and should not be used anymore.
static applyOrderPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
Applies the applicable order promotions in the specified collection to the specified line item container.
static applyProductPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
Applies all applicable product promotions in the specified collection to the specified line item container.
static applyShippingPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
Applies all applicable shipping promotions in the specified collection to the specified line item container.
static getApplicableConditionalPromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a qualifiying product.
static getApplicablePromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a discounted product.
static getApplicablePromotions(lineItemCtnr : LineItemCtnr) : Collection
Returns the enabled promotions of active campaigns applicable for the current customer, source code and any coupon contained in the specified line item container.
static getApplicablePromotions() : Collection
Returns the enabled promotions of active campaigns applicable for the current customer and source code.
static getCampaignByID(id : String) : Campaign
Returns the campaign identified by the specified ID.
static getConditionalPromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns for which the specified product is a qualifiying product.
static getPromotion(couponCode : String) : Promotion
Returns the promotion associated with the specified coupon code.
static getPromotionByCouponCode(couponCode : String) : Promotion
Returns the promotion associated with the specified coupon code.
static getPromotionByID(id : String) : Promotion
Returns the promotion identified by the specified ID.
static getPromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns for which the specified product is a discounted product.
Methods inherited from class Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Method Detail
applyBonusPromotions
static applyBonusPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
This method has been deprecated and should not be used anymore. Instead, use PromotionMgr to apply promotions to line item containers.
The method does nothing, since bonus promotions are applied as product or order promotions using methods applyProductPromotions(LineItemCtnr, Collection) and applyOrderPromotions(LineItemCtnr, Collection).
The method returns 'true' if any the line item container contains any bonus product line items, and otherwise false.
Deprecated:
Use PromotionMgr instead.
Parameters:
lineItemCtnr - Basket or order
promotions - Parameter not used, can be null
Returns:
True if line item container contains bonus product line items, else false
applyOrderPromotions
static applyOrderPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
Applies the applicable order promotions in the specified collection to the specified line item container.
This method has been deprecated and should not be used anymore. Instead, use PromotionMgr to apply promotions to line item containers.
Note that the method does also apply any bonus discounts defined as order promotions (see also applyBonusPromotions(LineItemCtnr, Collection)).
Deprecated:
Use PromotionMgr
Parameters:
lineItemCtnr - basket or order
promotions - list of all promotions to be applied
Returns:
true if changes were made to the line item container, false otherwise.
applyProductPromotions
static applyProductPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
Applies all applicable product promotions in the specified collection to the specified line item container.
This method has been deprecated and should not be used anymore. Instead, use PromotionMgr to apply promotions to line item containers.
Note that the method does also apply any bonus discounts defined as product promotions (see also applyBonusPromotions(LineItemCtnr, Collection)).
Deprecated:
Use PromotionMgr
Parameters:
lineItemCtnr - basket or order
promotions - list of all promotions to be applied
Returns:
true if changes were made to the line item container, false otherwise.
applyShippingPromotions
static applyShippingPromotions(lineItemCtnr : LineItemCtnr, promotions : Collection) : boolean
Applies all applicable shipping promotions in the specified collection to the specified line item container.
This method has been deprecated and should not be used anymore. Instead, use PromotionMgr to apply promotions to line item containers.
Deprecated:
Use PromotionMgr
Parameters:
lineItemCtnr - basket or order
promotions - list of all promotions to be applied
Returns:
true if changes were made to the line item container, false otherwise.
getApplicableConditionalPromotions
static getApplicableConditionalPromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a qualifiying product.
As a replacement of this deprecated method, use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product). Unlike getApplicableConditionalPromotions(Product), PromotionPlan.getProductPromotions(Product) returns all promotions related to the specified product, regardless of whether the product is qualifying, discounted, or both, and also returns promotions where the product is a bonus product.
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product)
Parameters:
product - Qualifying product
Returns:
List of active promotions
getApplicablePromotions
static getApplicablePromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a discounted product.
Note that this method does not return any coupon-based promotions.
As a replacement of this deprecated method, use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product). Unlike getApplicablePromotions(Product), PromotionPlan.getProductPromotions(Product) returns all promotions related to the specified product, regardless of whether the product is qualifying, discounted, or both, and also returns promotions where the product is a bonus product.
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product)
Parameters:
product - The product whose promotions are returned.
Returns:
A list of promotions
getApplicablePromotions
static getApplicablePromotions(lineItemCtnr : LineItemCtnr) : Collection
Returns the enabled promotions of active campaigns applicable for the current customer, source code and any coupon contained in the specified line item container.
Note that although the method has been deprecated, no replacement method is provided.
Deprecated:
There is no replacement for this method.
Parameters:
lineItemCtnr - the basket or order
Returns:
list of all applicable promotion for the given basket or order
getApplicablePromotions
static getApplicablePromotions() : Collection
Returns the enabled promotions of active campaigns applicable for the current customer and source code.
Note that this method does not return any coupon-based promotions.
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getPromotions()
Returns:
List of active promotions
getCampaignByID
static getCampaignByID(id : String) : Campaign
Returns the campaign identified by the specified ID.
Deprecated:
Parameters:
id - Campaign ID
Returns:
Campaign or null if not found
getConditionalPromotions
static getConditionalPromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns for which the specified product is a qualifiying product.
Note that the method also returns coupon-based promotions.
As a replacement of this deprecated method, use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product). Unlike getConditionalPromotions(Product), PromotionPlan.getProductPromotions(Product) returns all promotions related to the specified product, regardless of whether the product is qualifying, discounted, or both, and also returns promotions where the product is a bonus product.
Deprecated:
Use PromotionMgr.getActivePromotions() and PromotionPlan.getProductPromotions(Product)
Parameters:
product - The product whose conditional promotions are returned.
Returns:
A list of promotions
getPromotion
static getPromotion(couponCode : String) : Promotion
Returns the promotion associated with the specified coupon code.
Deprecated:
Coupons are now related to multiple promotions. Method returns the first promotion associated with the coupon code in case of multiple assigned promotions.
Parameters:
couponCode - The coupon code used to lookup the promotion
Returns:
The resolved promotion object or null if none was found
getPromotionByCouponCode
static getPromotionByCouponCode(couponCode : String) : Promotion
Returns the promotion associated with the specified coupon code.
Deprecated:
Coupons are now related to multiple promotions. Method returns the first promotion associated with the coupon in case of multiple assigned promotions
Parameters:
couponCode - Coupon code
Returns:
The associated promotion or null
getPromotionByID
static getPromotionByID(id : String) : Promotion
Returns the promotion identified by the specified ID.
Deprecated:
Parameters:
id - Promotion ID
Returns:
Promotion or null if not found
getPromotions
static getPromotions(product : Product) : Collection
Returns the enabled promotions of active campaigns for which the specified product is a discounted product.
Note that method does only return promotions based on customer groups or source codes.
As a replacement of this deprecated method, use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product). Unlike getPromotions(Product), PromotionPlan.getProductPromotions(Product) returns all promotions related to the specified product, regardless of whether the product is qualifying, discounted, or both, and also returns promotions where the product is a bonus product.
Deprecated:
Use PromotionMgr.getActivePromotions() and PromotionPlan.getProductPromotions(Product)
Parameters:
product - Discounted product
Returns:
List of promotions