OrderLevelDiscountApply

Use this component to apply order level subtotal discounts.

Intended use: Order Processing pipeline, Order Adjust Price stage, between OrderDiscount and RequiredOrderAdjustPriceCy components.

In the Component Properties dialog box, on the Order Level Discount tab, do the following:

Use this To do this
Apply discounts to all items Apply order level discounts to all items in the order form.
Apply discounts to items where the following key exists and the corresponding value is nonzero Apply order level discounts only to items in the order form where the specified item dictionary key exists and the corresponding value is nonzero.

Click Apply to save your changes.

For more information about discount interactions, see Order Subtotal Discount.

Configuration Values

None.

Values Read

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

Key Dictionary Description
item.quantity Order Required. The total quantity of all the line items.

Type: Integer (VT_I4)

item._cy_iadjust_currentprice Order Required. The current price of all the line items.

Type: Currency (VT_CY)

item._cy_oadjust_adjustedprice Order Optional (default is 0.0). The total price of all the items, after all the discounts have been applied.

Type: Currency (VT_CY)

Ee796432.note(en-US,CS.20).gifNote

  • Total price for the line item can be computed as the following:

    _n_unadjusted*_cy_iadjust_currentprice+_cy_oadjust_adjustedprice

item._n_unadjusted Order Optional (default is equal to the quantity). The quantity of line items that have not been adjusted bythe OrderDiscount component or other discounting components (number of line items that are eligible to serve as discount conditions and receive discount awards).

Type: Integer (VT_I4)

_orderlevel_discounts_detail Order Optional. A dictionary that maps special offer types to a list of order level discounts that applies for that special offer type.

Each element is a dictionary. The exact format of the dictionary depends on whether the element represents a combination of percentage-off discounts of the same priority, or a single discount.

Following are the dictionary entries if the element represents a single discount:

  • discount_id: Integer (VT_I4)
  • discount_timestamp: Last_modified timestamp of the discount (VT_DATE)
  • discount_name: Discount name (VT_BSTR)

Following are the dictionary entries if the element represents a combined percentage-off discount:

  • discounts_combined: A SimpleList object that describes each of the discounts that were combined. Each element in this list is a dictionary with the following keys:
    • discount_id: Integer (VT_I4)
    • cy_discount_percentage: Value (VT_CY)
    • discount_timestamp: Last_modified timestamp of the discount (VT_DATE)
    • discount_name: Discount name (VT_BSTR)

Following are the dictionary entries that exist in both cases:

  • discount_priority: Priority (rank)
  • discount_type: 1=Currency; 2=Percentage (VT_I4)
  • cy_discount_value: Currency or percentage value (VT_CY). If the element represents a combined percentage-off discount, this is the total percentage.

The order the elements appear in the list is significant, because it is the order that OrderDiscount has determined they should be applied.

Type: Currency (VT_CY)

Ee796432.note(en-US,CS.20).gifNote

  • This is the list used by OrderDiscount to specify to other pipeline components the complete list of order level discounts that should be applied to the basket.
_currency_decimal_places Order Optional (if not set, the _currency_lcid key must be set, and the number of currency decimal places will be the default for that locale). Describes the number of digits of precision (after the decimal point) for which to round certain intermediate results, and to round to when writing currency values into the OrderForm object.

Type: Integer (VT_I4)

_currency_lcid Order Optional (required only if the _currency_decimal_places key is not set). Describes a locale (LCID) to use to retrieve the number of currency decimal places.

Type: Integer (VT_I4)

SiteName Context Optional. Used only for reporting the site name as part of several limited error messages, which may be reported to the Event log.

Type: String

Values Written

The OrderDiscountApply component writes the following values to the Order dictionary.

Key Description
item._cy_orderlevel_discounts_subtotal Not always written (only written if one or more order level discounts apply to the line item). The sum of all order level subtotal discounts applied to this line item. This key is written even if the discount applied has no impact on the price.

Type: Currency (VT_CY)

item._orderlevel_discounts_applied Not always written. A SimpleList of dictionaries where each dictionary contains information about an item level discount that was applied to the line item. The order of the list is significant and represents the order in which the discounts were applied to this line item. This key is written even if the discount applied has no impact on the price.

The dictionary contains the following elements for each discount:

  • discount_id: Campaign item ID (VT_I4)
  • discount_priority: Discount priority (rank) (VT_I4)
  • discount_timestamp: Last-modified timestamp of the discount (VT_DATE)
  • cy_discount_amount: How much was actually taken off of the item (VT_CY)
  • discount_type: 1=Currency Value; 2=Percentage (VT_I4)
  • cy_discount_value: Currency value or percentage value (VT_CY)
  • discount_name: Discount name (VT_BSTR)

Type: Dictionary (VT_DISPATCH)

item._cy_oadjust_adjustedprice Not always written (default is 0.0). The total price of all the items, after all the discounts have been applied.

Type: Currency (VT_CY)

Ee796432.note(en-US,CS.20).gifNotes

  • The price for the line item can be ccomputed as the following:
_n_unadjusted*_cy_iadjust_currentprice+_cy_oadjust_adjustedprice
  • If a discount applies to this line item, the entire quantity is considered adjusted. Therefore, it will be the total price for the line item after all item level and order level discounts are applied.
item._n_unadjusted Not always written (only for items to which a discount will apply by this component). The quantity of items in this line that have not been adjusted.

Type: Integer (VT_I4)

Ee796432.note(en-US,CS.20).gifNote

  • If a discount applies to this line item, the entire quantity is considered adjusted, so it will be set to zero.

Remarks

For information about extending the OrderLevelDiscountApply component, see Order Level Discount Pipeline Components.

See Also

Discount Objects

CSFLoadDiscounts

ScoreDiscounts

ShippingDiscountAdjust

Copyright © 2005 Microsoft Corporation.
All rights reserved.