Class CampaignMgr

CampaignMgr provides static methods for managing campaign-specific operations such as accessing promotions or updating promotion line items.

Deprecated:

Use PromotionMgr instead.

PropertyDescription
applicablePromotions: Collection (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.

MethodDescription
static applyBonusPromotions(LineItemCtnr, Collection)This method has been deprecated and should not be used anymore.
static applyOrderPromotions(LineItemCtnr, Collection)Applies the applicable order promotions in the specified collection to the specified line item container.
static applyProductPromotions(LineItemCtnr, Collection)Applies all applicable product promotions in the specified collection to the specified line item container.
static applyShippingPromotions(LineItemCtnr, Collection)Applies all applicable shipping promotions in the specified collection to the specified line item container.
static getApplicableConditionalPromotions(Product)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()Returns the enabled promotions of active campaigns applicable for the current customer and source code.
static getApplicablePromotions(Product)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)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 getCampaignByID(String)Returns the campaign identified by the specified ID.
static getConditionalPromotions(Product)Returns the enabled promotions of active campaigns for which the specified product is a qualifiying product.
static getPromotion(String)Returns the promotion associated with the specified coupon code.
static getPromotionByCouponCode(String)Returns the promotion associated with the specified coupon code.
static getPromotionByID(String)Returns the promotion identified by the specified ID.
static getPromotions(Product)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): 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.

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): 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)).

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): 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)).

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): 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.

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): 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.

Parameters:

  • product - Qualifying product

Returns:

  • List of active promotions

Deprecated:

Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getProductPromotions(Product)


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.

Returns:

  • List of active promotions

Deprecated:

Use PromotionMgr.getActiveCustomerPromotions() and PromotionPlan.getPromotions()


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.

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): 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.

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): Campaign

Returns the campaign identified by the specified ID.

Parameters:

  • id - Campaign ID

Returns:

  • Campaign or null if not found

Deprecated:

Use PromotionMgr.getCampaign(String)


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.

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): Promotion

Returns 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): Promotion

Returns 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): Promotion

Returns the promotion identified by the specified ID.

Parameters:

  • id - Promotion ID

Returns:

  • Promotion or null if not found

Deprecated:

Use PromotionMgr.getPromotion(String)


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.

Parameters:

  • product - Discounted product

Returns:

  • List of promotions

Deprecated:

Use PromotionMgr.getActivePromotions() and PromotionPlan.getProductPromotions(Product)