Using the Splitter Component to Create Multiple Shipments
The Splitter component allows you to split orders based on any of the attributes of the line items. The default distinguishers for splitting orders are shipping
_method
_id
and shipping
_address
_id
keys. You can specify other keys to use as criteria in the InputDistinguishers box on the ComponentProperties tab, which can be displayed by double-clicking the Splitter component in the Pipeline Editor.
Each line in the following table represents a dictionary pointed to by an element of the SimpleList object. The dictionaries also include a key, ItemIndexes
, which is a reference to a SimpleList object. Each element in the SimpleList object is an index into the LineItems dictionary, containing line items in the actual order.
The following example has four line items, numbered zero through three. The following table contains a list of some of their attributes.
shipping_method_id | shipping_address_id | shipping_date | catalog | vendor |
---|---|---|---|---|
A | Home | ASAP | A | A |
A | Home | ASAP | A | A |
B | Work | ASAP | B | B |
A | Work | 3/1 | C | B |
If you split the previous information by the distinguishers shipping
_method
_id
and shipping
_address
_id
, to an output structure called _shipments
, a SimpleList object of dictionaries will be on your order form called ""shipments"" with the following entries:
shipping_method_id | shipping_address_id | ItemIndexes |
---|---|---|
A | Home | 0,1 |
B | Work | 2 |
A | Work | 3 |
If you sort the the four line items by vendor, to an output structure called _Vendors
, a SimpleList of dictionaries will be on your order form called ""_Vendors"" with the following entries:
vendor | ItemIndexes |
---|---|
A | 0,1 |
B | 2,3 |
Previewing shipping costs for a user is more complex when shipments are split. You can use the PreviewShipments method of the Shipping object to get the data to display in your ASP page. For more information, see Shipping.PreviewShipments.
See Also
Overview of the Multiple-shipment Shipping Architecture
Setting Up the Pipeline and Cache
Adding Shipping Methods and Components
Shipping and Address Structures
Copyright © 2005 Microsoft Corporation.
All rights reserved.