OrderLevelDiscountApply
Use the OrderLevelDiscountApply pipeline component to apply order-level subtotal discounts.
Intended use: Order Processing pipeline, Order Adjust Price stage.
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.
Values Read
The OrderLevelDiscountApply pipeline component reads the following values from the indicated dictionaries.
Key |
Dictionary |
Description |
---|---|---|
item._cy_iadjust_currentprice |
Order |
Required. The current price of all the line items. Type: Currency (VT_CY) |
item.quantity |
Order |
Required. The total quantity of all the line items. Type: Integer (VT_I4) |
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)
Note:
Total price for the line item can be computed as the following:
Note:
_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 by the 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 |
This component reads discount_basket_display value from each entry. This is 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. The following are the dictionary entries if the element represents a single discount:
The following are the dictionary entries if the element represents a combined percentage-off discount:
The following are the dictionary entries that exist in both cases:
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)
Note:
This is the list that is used by OrderDiscount to specify to other pipeline components the complete list of order level discounts that should be applied to the basket.
|
SiteName |
Context |
Optional. Used only for reporting the site name as part of several limited error messages that may be reported to the event log. Type: String |
Values Written
The OrderLevelDiscountApply pipeline component writes the following values to the Order dictionary.
Key |
Description |
---|---|
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)
Note:
The price for the line item can be computed as the following:_n_unadjusted*_cy_iadjust_currentprice+_cy_oadjust_adjustedprice
Note:
If a discount applies to this line item, the whole 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)
Note:
If a discount applies to this line item, the whole quantity is considered adjusted. Therefore, it will be set to zero.
|
_orderlevel_discounts_applied |
Optional. This component writes discount_basket_display into each entry in the list. This is a SimpleList of Dictionaries where each Dictionary contains information about an order-level discount that was applied to the order. 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 affect the price. The dictionary contains the following elements for each discount:
Type: Dictionary (VT_DISPATCH) |
item._cy_orderlevel_discounts_subtotal |
Optional. 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 affect the price. Type: Currency (VT_CY) |