Share via


TableShippingADO

Use this component to set the total shipping on an order by using values retrieved from the database.

Intended use: Order Processing pipeline, Shipping stage.

Configuration Values

You can determine when the TableShippingADO component calculates the handling charge by setting component properties. Use the following boxes on the Table Shipping (ADO) tab of the Component Properties dialog box to determine this information.

Field Description
Apply when Determines when to apply the shipping charge. The values are:

Always

Default. Specifies that the shipping charge is always applied to the order.

Equal to method

The shipping charge should be applied when the value of the shipping_method key in the Order dictionary is the same as the string specified in the Method box.

Has any value

Specifies that the shipping charge should be applied when the shipping_method key of the order has any non-null value.

Method The shipping method to match against the value of the shipping_method key in the Order dictionary. Used when the value in the Apply when box is set to the value in the Equal to method box.
Connection String The connection string to connect to the database. This may be a full connection string or a name in a connection map. If blank, the default connection string is used.
Query The full SQL text of the query this component will execute, or the name of a query whose full SQL text is defined in the Global.asa file in the QueryMap key.
Parameter List The parameters the component passes to the query. Separate multiple parameters with a single space. The following are the allowed parameters:

count

Passes the query the number of line items on the order.

order.fieldname

Passes the value of the specified field in the order form.

sum.fieldname

The query receives the sum of a particular field on the order.

sumq.fieldname

Passes the sum times the respective quantities.

Column The name of the column in the database containing the handling charge.

Values Read

The TableShippingADO component reads the following values from the indicated dictionaries.

Key Dictionary Description
shipping_method Order Optional. The shipping method as a string.
DefaultConnectionString Context Optional. The key in the Application dictionary containing the default query string.
ConnectionStringMap Context Optional. The map in which to look up the name of a mapped connection string.
QueryMap Context Optional. A reference to a dictionary containing a query map.

Values Written

The TableShippingADO component assigns a value to the following key in the Order dictionary.

Key Description
_handling_total The total cost for handling the order.

Remarks

The TableShippingADO component sets the value of the _shipping_total key on the order form using values retrieved from the database.

Be sure to remove the DefaultShipping component from the pipeline if you use the TableShippingADO component.

The combination of the values in the Key, Apply when, and Method boxes determine whether the shipping charge should be applied to the order.

The TableShippingADO component first checks the Apply when value. If it is set to Always, the shipping charge is always applied to the order. If the Apply when value is set to Has any value, the shipping charge is applied to the order whenever the order form contains any value for the shipping_method key. If the value in the Apply when box is set to the value in the Equal to Method box, the component does a comparison between the value of the shipping_method key on the order form and the text string in the Method box on this property page. If there is a match, the shipping charge is applied.

If the component determines that the shipping charge should be applied, it executes the query specified in the Query box, which retrieves the shipping charge from the database column specified in the Column box. The component then computes the shipping charge.

The value in the Parameter List box is used to specify parameters to the query, which usually includes a basis for the table lookup. The basis can be total cost of the order, or a merchant-defined value such as weight.

The following table illustrates some useful values for the Basis Item Key box.

Example Basis Item Key Result
order._oadjust_subtotal The subtotal on the order form.
sum.quantity The sum of all quantities (total number of items ordered).
sum._oadjust_adjustedprice The sum of adjusted prices.
sumq._iadjust_currentprice The sum of current price times quantity for all items in the order.
sumq._product_weight The total weight of order. (Assumes that the weight column exists in the product table, and that the query used by the QueryProdInfoADO component includes this field.)

For example, if the sumq._product_weight key is specified, and if the order has two items, one item weighing 2 pounds with a quantity of 3 and the other item weighing 4 pounds with a quantity of 1, then the basis value is 10 pounds.


All rights reserved.