Class CampaignMgr
CampaignMgr provides static methods for managing campaign-specific operations such as accessing promotions or updating promotion line items.
Deprecated:
Use PromotionMgr instead.
| Property | Description |
|---|---|
(read-only) | Returns the enabled promotions of active campaigns applicable for the current customer and source code. |
This class does not have a constructor, so you cannot create it directly.
| Method | Description |
|---|---|
| This method has been deprecated and should not be used anymore. | |
| Applies the applicable order promotions in the specified collection to the specified line item container. | |
| Applies all applicable product promotions in the specified collection to the specified line item container. | |
| Applies all applicable shipping promotions in the specified collection to the specified line item container. | |
| Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a qualifiying product. | |
| Returns the enabled promotions of active campaigns applicable for the current customer and source code. | |
| Returns the enabled promotions of active campaigns applicable for the current customer and source code for which the specified product is a discounted product. | |
| Returns the enabled promotions of active campaigns applicable for the current customer, source code and any coupon contained in the specified line item container. | |
| Returns the campaign identified by the specified ID. | |
| Returns the enabled promotions of active campaigns for which the specified product is a qualifiying product. | |
| Returns the promotion associated with the specified coupon code. | |
| Returns the promotion associated with the specified coupon code. | |
| Returns the promotion identified by the specified ID. | |
| Returns the enabled promotions of active campaigns for which the specified product is a discounted product. |
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
applicablePromotions: Collection(read-only)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()
static applyBonusPromotions(lineItemCtnr: LineItemCtnr, promotions: Collection): BooleanThis 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.
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
Deprecated:
Use PromotionMgr instead.
static applyOrderPromotions(lineItemCtnr: LineItemCtnr, promotions: Collection): BooleanApplies 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)).
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.
Deprecated:
Use PromotionMgr
static applyProductPromotions(lineItemCtnr: LineItemCtnr, promotions: Collection): BooleanApplies 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)).
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.
Deprecated:
Use PromotionMgr
static applyShippingPromotions(lineItemCtnr: LineItemCtnr, promotions: Collection): BooleanApplies 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.
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.
Deprecated:
Use PromotionMgr
static getApplicableConditionalPromotions(product: Product): CollectionReturns 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.
Parameters:
- product - Qualifying product
Returns:
- List of active promotions
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product)
static getApplicablePromotions(): CollectionReturns 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.
Returns:
- List of active promotions
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getPromotions()
static getApplicablePromotions(product: Product): CollectionReturns 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.
Parameters:
- product - The product whose promotions are returned.
Returns:
- A list of promotions
Deprecated:
Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product)
static getApplicablePromotions(lineItemCtnr: LineItemCtnr): CollectionReturns 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.
Parameters:
- lineItemCtnr - the basket or order
Returns:
- list of all applicable promotion for the given basket or order
Deprecated:
There is no replacement for this method.
static getCampaignByID(id: String): CampaignReturns the campaign identified by the specified ID.
Parameters:
- id - Campaign ID
Returns:
- Campaign or null if not found
Deprecated:
static getConditionalPromotions(product: Product): CollectionReturns 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.
Parameters:
- product - The product whose conditional promotions are returned.
Returns:
- A list of promotions
Deprecated:
Use PromotionMgr.getActivePromotions() and PromotionPlan.getProductPromotions(Product)
static getPromotion(couponCode: String): PromotionReturns the promotion associated with the specified coupon code.
Parameters:
- couponCode - The coupon code used to lookup the promotion
Returns:
- The resolved promotion object or null if none was found
Deprecated:
Coupons are now related to multiple promotions. Method returns the first promotion associated with the coupon code in case of multiple assigned promotions.
static getPromotionByCouponCode(couponCode: String): PromotionReturns the promotion associated with the specified coupon code.
Parameters:
- couponCode - Coupon code
Returns:
- The associated promotion or null
Deprecated:
Coupons are now related to multiple promotions. Method returns the first promotion associated with the coupon in case of multiple assigned promotions
static getPromotionByID(id: String): PromotionReturns the promotion identified by the specified ID.
Parameters:
- id - Promotion ID
Returns:
- Promotion or null if not found
Deprecated:
static getPromotions(product: Product): CollectionReturns 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.
Parameters:
- product - Discounted product
Returns:
- List of promotions
Deprecated:
Use PromotionMgr.getActivePromotions() and PromotionPlan.getProductPromotions(Product)