次の方法で共有


RequiredOrderInitCy

Use the RequiredOrderInitCy pipeline component to initialize the order ID, totals, and subtotals in an order form.

For more information, see Currency Enhancements.

Intended use: Order Processing pipeline, Order Initialization stage.

Configuration Values

None.

Values Read

The RequiredOrderInitCy pipeline component reads the following values from the indicated dictionaries.

Key

Dictionary

Description

order_id

Order

The ID of the order.

item.quantity

Order

The quantity of an item.

Values Written

The RequiredOrderInitCy pipeline component writes the following values to the Order dictionary.

Key

Description

order_id

The ID of the order.

item._cy_oadjust_adjustedprice

The total price of all the items, after all the discounts have been applied.

item._n_unadjusted

The number of items that have not been discounted.

item._cy_itemlevel_discounts_subtotal

Sum of all item level discounts apply to this line item.

item._cy_orderlevel_discounts_subtotal

The sum of all order level subtotal discounts applied to this line item.

item._itemlevel_discounts_applied

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.

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

item._orderlevel_discounts_applied

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 order.

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

item._discounts_removed

The RequiredOrderInitCy pipeline component deletes this key.

item._discounts_charged

The RequiredOrderInitCy pipeline component deletes this key.

_cy_total_total

The total cost of the order. The RequiredOrderInitCy pipeline component deletes this key.

_cy_oadjust_subtotal

The subtotal of all items in the items list. The RequiredOrderInitCy pipeline component deletes this key.

_cy_shipping_total

The total cost of shipping all items in the order. The RequiredOrderInitCy pipeline component deletes this key.

_cy_tax_total

The total tax for the order. The RequiredOrderInitCy pipeline component deletes this key.

_cy_handling_total

The total handling cost for the order. The RequiredOrderInitCy pipeline component deletes this key.

_cy_tax_included

The RequiredOrderInitCy pipeline component deletes this key.

_orderlevel_discounts_detail

The RequiredOrderInitCy pipeline component deletes this key.

Remarks

First, the RequiredOrderInitCy pipeline component makes sure that the order_id key has a value. If it does not, the RequiredOrderInitCy pipeline component generates a unique order ID and assigns it to this key.

Next, to guarantee order integrity, the component initializes the following keys by assigning NULL to them:

  • _cy_total_total

  • _cy_oadjust_subtotal

  • _cy_shipping_total

  • _cy_tax_total

  • _cy_handling_total

  • _cy_tax_included

  • _payment_auth_code

Finally, for each item in the items collection, the RequiredOrderInitCy pipeline component copies the value that is stored in the quantity key to the value of the _n_unadjustedkey to initialize the undiscounted quantity of the item, and initializes the _oadjust_adjustedprice (the total cost of the item) key to zero (0).

See Also

Other Resources

Pipeline Component Reference