Partager via


What Are OrderForm Objects and Dictionaries?

An OrderForm describes a shopping session and includes customer data, product data, payment data, and more. There are two representations for this data: as an object, and as a dictionary. The runtime uses an OrderForm object, which is an instance of a .NET class. Pipeline components use the dictionary representation of an OrderForm. Commerce Server Core Systems automatically keeps these two representations in sync, so that changes to one representation are reflected in the other representation.

A dictionary is a set of items and an item is a name/value pair. Dictionaries can be nested; that is, a value of an item can itself be a dictionary.

Pipeline components process an OrderForm and often record the results of their work by adding an item to the OrderForm dictionary or by modifying the value of an existing item. The following list identifies the most common actions that pipeline components perform on a dictionary:

  • Name and value creation. Several pipeline components create new items in an OrderForm dictionary. For example, the QueryCatalogInfo component gathers information about a product from a database, creates a new item name by prepending _product_to the database column name, and adds the resulting name and value to the OrderForm dictionary.

  • Name and value initialization. The pipeline components whose names start with the word "Required" check to make sure that the certain items already have values. If they do not, the pipeline component initializes the value. For example, the RequiredOrderInitCy pipeline component sets the _cy_total_total, _cy_oadjust_subtotal, _cy_shipping_total, _cy_tax_total, and _cy_handling_total keys to NULL.

  • Name and value verification. Some pipeline components verify that an item has a valid value. For example, the RequiredItemAdjustPriceCy pipeline component verifies that prices have not changed while the user was shopping by comparing the values of cy_iadjust_currentprice and cy_placed_price. If the values are not equal, the RequiredItemAdjustPriceCy pipeline component adds a message to the _Basket_Errors item.

  • Name and value calculation. Certain pipeline components calculate the value of an item based on the work that other pipeline components perform. For example, the components in the Tax stage calculate the tax on an order and save the tax in an item named _tax_total.

Note

An item whose name begins with an underscore ("_") serves as a temporary variable and is not persisted to the database.

In This Section