Previous in Contents Next in Contents

TableHandling

The TableHandling component, which appears in the Handling stage of an order processing pipeline, sets the value of _handling_total on the order form by using values retrieved from the database.

Note  This component is used for compatibility with Commerce Server 2.0 sites, in which the database connection is provided by the Content object in the Pipe Context. Commerce Server 3.0 sites should use the TableHandlingADO component.

Remarks

The combination of the Key, Apply when, and Method fields determine whether the handling should be applied to the order.

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

If the component determines that the handling charge should be applied, it then executes the query specified in Query. This query retrieves the per-item and per-order handling charges from the database, and then uses the value of the Basis Item Key to compute the handling charge.

The Method name, the aggregated basis, and the value of the location are given as arguments to the query, which must return a single number as a result. With some databases, the query must refer to all three variables, even if it does not need them (see the following example):

select cost, :2, :3 from shipping_costs
where min_weight <= :1 and max_weight > :1

The :2 and :3 refer to the location and method, respectively. These are the database column number references. The component ignores the return fields after the first, but some databases will issue an error if you do not refer to them at all. The :1 refers to the product weight.

Related Topics


© 1997-2000 Microsoft Corporation. All rights reserved.