ScoreDiscounts

Use this component in discount promotion selection to adjust scores of discount items to promote discounts most relevant to the current user.

Although the component appears as ScoreDiscounts in the Pipeline Editor, its ProgID is Commerce.CSFScoreDiscounts.

Intended use: Content Selection pipeline, Scoring stage.

Configuration Values

None.

Values Read

The ScoreDiscounts component reads the following values from the indicated dictionaries.

Key Dictionary Description
_content Order A reference to the ContentList object. Multiple fields are read. For more information, see the Remarks section..
Evaluator Context A reference to the Expression Evaluator component to use.
ContextProfile Context Optional. The ContentSelector object (a dictionary) used in expression evaluation.

A SimpleList object of dictionaries can also be read from the ContextProfile object from a key named Products. Typically, this is a list of the products the user is viewing or browsing (on the current page, for example). This product list should have the same format as the items list in an OrderForm object once the QueryCatalogInfo component has been run on it, making all product attributes available for discount expressions.

UserProfile Context Optional. A reference to a ProfileObject object containing the user profile for the current user that is used in expression evaluation.
Items ContextProfile Optional. The items collection from the OrderForm object.

This list of products should have the same format as the items list in an OrderForm object once the QueryCatalogInfo component has been run on it, making all attributes of a product available for discount expressions.

trace Context Optional. A Boolean indicating whether score adjustment tracing is enabled. This component will not produce trace strings unless this key is set to True.

The ScoreDiscounts component reads the following values for each item in the ContentList object referred to by the _content key.

Key Description
required_exprs The required expressions built on User and Context profiles. This is an array of expression IDs that must be True; otherwise the discount is assigned a score of zero (0).
condition_expr The discount condition expression.
award_expr The award condition expression.
date_start The date the discount becomes active.
date_end The date the discount expires.

Values Written

The ScoreDiscounts component writes the following value to the Order dictionary.

Key Description
_content A reference to the ContentList object. The score key of each content item in the object is assigned a value.

Remarks

This component adjusts the score of discount content items with the goal of promoting discounts most relevant to the current user. The algorithm is based on the following considerations:

  • The start and end dates of the discount. If the discount has not started, or has expired, it is disqualified.
  • Whether the item to be discounted is in the shopping basket.
  • Whether the item to be discounted is on the page being viewed (in the products list).

The following table lists the multipliers used based on the various combinations of the conditions and awards being met in the basket, in the products list, or not met. A condition or award being "met" means that the expression evaluates to True, but not necessarily that the cost or quantity amount was met. More than one entry in the table below may be met. The first one met is the one applied.

Condition Award Multiplier Description
Met in basket Applies to all (or free shipping) 0.5 The user is already receiving the benefit of the discount.
Met in basket Met in basket 0.5 The user is already receiving the benefit of the discount.
Met in basket Met in products 1.6 The user has half the discount in the basket, and is in the part of the site with the other half.
Met in basket Not met 1.4 The user has half the discount in the basket.
Met in products Applies to all (or free shipping) 1.2 The user is in the part of the site with half the discount.
Met in products Met in basket 1.6 The user has half the discount in the basket, and is in the part of the site with the other half.
Met in products Met in products 1.4 The user is in the part of the site with both halves of the discount.
Met in products Not met 1.2 The user is in the part of the site with half the discount.
Not met Applies to all (or free shipping) 1.0 Neutral context.
Not met Met in basket 1.4 The user has half the discount in the basket.
Not met Met in products 1.2 The user is in the part of the site with half the discount.
Not met Not met 1.0 Neutral context.

The OrderDiscount component applies the discounts whose scores are adjusted by the ScoreDiscounts component. The ScoreDiscounts component saves the scores in the ContentList object held by the CacheManager object. That ContentList object is then used by the OrderDiscount component in another pipeline.

See Also

Discount Objects

CSFLoadDiscounts

OrderDiscount

Copyright © 2005 Microsoft Corporation.
All rights reserved.