The Plan Pipeline

The Plan pipeline consists of 14 stages. These stages consist of components that verify the integrity of the OrderForm. For example, if the items list in an OrderForm contains no items, then the RequiredProdInfo component in the Product Info stage fails.

The template for this pipeline is Plan.pct. Examples of pipelines based on this template include the Plan.pcf files that appear in the \Config directory for the Volcano Coffee and Clocktower sample sites.

The Plan pipeline template consists of the following stages.

Product Info Stage

The Product Info stage contains components that retrieve product information about the items in the items list from the site database. If information about a given item cannot be retrieved, Product Info stage components mark the item for deletion by creating a delete name/value pair in the item Dictionary, and initializing the name/value pair to one (1).

After the Product Information components have been executed, the required component in the Product Information stage iterates through the items list, deleting every item that has been marked for deletion.

The components related to this stage include the following.

Component Description
QueryProdInfo Executes a database query, based on the SKUs in the OrderForm's items list, and puts the returned data in the OrderForm’s items collection. If no data is found for the SKU, the item is marked for deletion, and a pur_badsku errir is added to the _Basket_Errors list.
QueryProdInfoADO Executes a database query, using the Microsoft® ActiveX® Data Objects (ADO). This component differs from QueryProdInfo in that the query that it executes can take multiple parameters, and can reference a query in the QueryMap Dictionary.
RequiredProdInfo
(embedded in stage)
If any items are marked for deletion, deletes them and writes appropriate error messages.

Merchant Information Stage

The Merchant Information stage can retrieve static merchant data and write the data to the OrderForm. Commerce Server 3.0 includes no component for this stage (other than Scriptor). However, you can add your own custom component to process merchant information.

Shopper Information Stage

The Shopper Information stage contains the DefaultShopperInfo component, which adds information about the customer to the OrderForm.

The components related to this stage include the following.

Component Description
DefaultShopperInfo
(included in template)
Initializes entries in the order form to contain the values read from the shopper dictionary.

Order Initialization Stage

The Order Initialization stage sets initial order information on the OrderForm, and verifies that the OrderForm contains an order ID.

The components related to this stage include the following.

Component Description
RequiredOrderInit
(embedded in stage)
Initializes values in the order form prior to processing the order.

Order Check Stage

The Order Check stage verifies that the order can be processed. If necessary and possible, alters the order so that it can be processed.

The components related to this stage include the following.

Component Description
RequiredOrderCheck Ensures that there is at least one item in the OrderForm.

Item Price Stage

The Item Price stage contains components that set the _iadjust_regularprice for each item in the items list and that verify that this value has been set. If this value cannot be set, an error is raised.

The purpose of this initialization is to ensure that the _iadjust_regularprice name/value pair contains the most current price information for the given SKU.

The components related to this stage include the following.

Component Description
DefaultItemPrice
(included in template)
For each item in the items list, initializes that item's _iadjust_regularprice name/value pair to the value stored in _product_list_price.
RequiredItemPrice
(embedded in stage)
Ensures that _iadjust_regularprice is set for each item in the items list.

Item Adjust Price Stage

The Item Adjust Price stage contains components that initialize the _iadjust_currentprice name/value pair. When this stage is complete, _iadjust_currentprice contains the current price of the item, adjusted for sales or promotions.

If no sale or promotion component is included by this stage, the name/value pair is set to the value stored in _iadjust_regularprice.

Once the item._iadjust_currentprice name/value pair has be set for an item, that item cannot be adjusted a second time. For example, if a stage includes both an ItemPromo and a SaleAdjust component, and an item on the order qualifies for both the promotion and the sale adjustment, the item’s _iadjust_currentprice will be initialized by the component that is executed first within the stage. This generalization applies for any combination of Item Price Adjust components that you include in your pipeline.

The components related to this stage include the following.

Component Description
ItemPromo Adjusts the _iadjust_currentprice name/value pair, based on promotional parameters.
SaleAdjust Determines whether an item is on sale. If it is, SaleAdjust sets the item’s _iadjust_currentprice name/value pair to the value stored in the _product_sale_price name/value pair.
RequiredItemAdjustPrice
(embedded in stage)
Verifies that the _iadjust_currentprice name/value pair is set.

Order Adjust Price Stage

The Order Adjust Price stage contains components that set the adjusted price of each item. This stage can use items other than those that are adjusted to adjust the order. This stage can use information used by the Item Price Adjust stage, as well as other information about the order.

The item._oadjust_adjustedprice name/value pair contains the total cost of a given item. For example, if a customer purchases three items costing $5.00 each, and none of the items are on sale or targeted by a promotion, the total for the item is $15.00. If two of the items are sold at the regular price, but the third is sold at half price (because of a promotion), the name/value pair is 12.50.

The components related to this stage include the following.

Component Description
DbOrderPromo Queries the database to determine a promotion amount.
DbOrderPromoADO Queries the database to determine a promotion amount.
RequiredOrderAdjustPrice
(embedded in stage)
Checks the _oadjust_adjustedprice member of every item in the items collection to ensure that it is set.

Order Subtotal Stage

The Order Subtotal stage calculates the subtotal for an order and stores the resulting value in the OrderForm’s _oadjust_subtotal name/value pair. The _oadjust_subtotal is the sum of the _oadjust_adjustedprice for all items.

The components related to this stage include the following.

Component Description
DefaultOrderSubtotal Calculates the subtotal for an order, and stores the result in the order._oadjust_subtotal.
RequiredOrderSubtotal
(embedded in stage)
Checks the order._oadjust_subtotal name/value pair to ensure that it is not NULL.

Shipping Stage

This stage calculates the total shipping charge for the order and sets the order._shipping_total name/value pair accordingly. For information about how the components in this stage interact, see Using the Shipping Components.

The components related to this stage include the following.

Component Description
DefaultShipping
(included in template)
Ensures the integrity of the OrderForm by setting order._shipping_total to zero (0).
FixedShipping Sets the order._shipping_total to a fixed amount.
LinearShipping Sets the order._shipping_total name/value pair by multiplying a rate by the sum of a specified value on the OrderForm.
TableShipping Sets the order._shipping_total name/value pair to a value returned by a specified query.
TableShippingADO Identical to TableShipping, except that TableShippingADO uses Microsoft® ActiveX® Data Objects (ADO) to perform the query, and can be included in a transacted pipeline.
RequiredShipping
(embedded in stage)
Checks the OrderForm to ensure that the order._shipping_total has been set.

Handling Stage

This stage calculates the total handling charge for the order and sets the order._handling_total name/value pair accordingly, if handling charges are not included in the shipping charge.

Multiple components can be specified to allow for different handling charges depending on the handling component used. The handling components are virtually identical to the shipping components; thus, you can use the shipping components to calculate shipping and handling charges together. However, some tax systems require shipping and handling charges to be calculated and taxed separately.

This stage verifies that order._handling_total is set. If not, it generates an error.

The components related to this stage include the following.

Component Description
DefaultHandling
(included in template)
Sets the order._handling_total name/value pair to zero (0).
FixedHandling Sets the order._handling_total name/value pair to a fixed amount.
LinearHandling Sets the order._handling_total name/value pair by multiplying a rate times the sum of a specified item on the OrderForm.
TableHandling Calculates the value for the order._handling_total name/value pair based on the results of a query.
TableHandlingADO Identical to the TableHandling component, except that TableHandlingADO uses Microsoft® ActiveX® Data Objects (ADO) to perform the query, and can be included in a transacted pipeline.
RequiredHandling
(embedded in stage)
Checks the OrderForm to ensure that the order._handling_total has been set.

Tax Stage

This stage computes the sales tax for each item on the order, and the sum of tax for the entire order. The stage sets the item._tax_total, order._tax_total, and order._tax_included name/value pairs accordingly. Multiple components can be specified to allow for different tax rates depending upon the destination country. For information about how these components interact, see Using the Tax Components.

The components related to this stage include the following.

Component Description
DefaultTax
(included in template)
Sets the OrderForm's _tax_total and _tax_included values to zero (0).
SimpleCanadaTax Computes a tax rate for Canada, including GST (goods and services tax) and PST (provincial sales tax).
SimpleJapanTax Computes the tax rate for the Japanese model.
SimpleUSTax Applies a given tax rate to any order sent to a specified state.
SimpleVATTax Computes a value-added tax (VAT) on the items.
RequiredTax
(embedded in stage)
Checks to make sure that the OrderForm’s _tax_total and _tax_included values are not NULL.

Order Total Stage

This stage sums the subtotal (less any discount), tax, shipping, and handling values and writes the total to the order._total_total name/value pair.

The components related to this stage include the following.

Component Description
DefaultTotal
(included in template)
Writes the total cost of the order to the _total_total name/value pair.
RequiredTotal
(embedded in stage)
Performs a _VERIFY_WITH check of the OrderForm.

Inventory Stage

This stage verifies that every item ordered is in stock. For information about how the inventory components interact, see Using the Inventory Components.

The components related to this stage include the following.

Component Description
FlagInventory Flags items in the items SimpleList that are out of stock.
LocalInventory Checks the OrderForm to ensure that an item does not require more of a given SKU than is in stock.
ReduceLocalInventory For backward compatibility


© 1997-1998 Microsoft Corporation. All rights reserved.