RequiredOrderAdjustPriceCy, RequiredOrderAdjustPrice
Use these components to adjust the total cost of each item in an order after applying any discounts.
Use these components to calculate the cost of undiscounted items and the amount of a discount for all items in the order.
The RequiredOrderAdjustPrice component is for backward compatibility only. The RequiredOrderAdjustPriceCy component operates in both Site Server 3.0 Commerce Edition compatibility mode and in Commerce Server 2000 mode pipelines.
Intended use: Order Processing pipeline, Order Adjust Price stage.
Configuration Values
None.
Values Read
The RequiredOrderAdjustPriceCy component reads the following values from the indicated dictionaries. The RequiredOrderAdjustPrice component reads the same keys but without cy_
.
Key | Dictionary | Description |
item._n_unadjusted |
Order | The quantity of this item that have not been discounted. |
item._cy_iadjust_currentprice |
Order | The current price of an item. |
item._cy_oadjust_adjustedprice |
Order | The total cost of an item before discounts. |
item.quantity |
Order | The total quantity of an item. |
Values Written
The RequiredOrderAdjustPriceCy component writes the following values to the indicated dictionaries. The RequiredOrderAdjustPrice component writes the same keys but without cy_
.
Key | Description |
item._cy_oadjust_adjustedprice |
The total cost of an item with discounts taken into account. |
item._cy_oadjust_discount |
The discount on an item. |
Remarks
The RequiredOrderAdjustPriceCy and RequiredOrderAdjustPrice components perform the same actions although on different dictionary keys. The following discussion uses the keys for the RequiredOrderAdjustPriceCy component.
The RequiredOrderAdjustPriceCy component processes each item in the items
collection of the OrderForm object.
For each item, the RequiredOrderAdjustPriceCy component first calculates the cost of the non-discounted quantity. It multiplies the current price of the item (_cy
_iadjust
_currentprice
) by the undiscounted quantity of the item (n
_unadjusted
) and adds it to the total cost of the item (_cy_oadjust_adjustedprice
).
Next, it calculates the discount for the item (cy
_oadjust
_discount
) by calculating the total cost for the item (multiplying the current price of the item (_cy
_iadjust
_currentprice
) by the total quantity (quantity
)) and subtracting the previously calculated cost of the undiscounted items.
The RequiredOrderAdjustPriceCy component is visible in the Pipeline Editor only when the Editor is run in expert mode.