Using the Splitter 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
. You can specify other keys to use as criteria in the InputDistinguishers box on the ComponentProperties tab.
Each line in the following table would represent a dictionary pointed to by an element of the SimpleList object.The dictionaries also include a key, ItemIndexes
, that 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 the previous information were split by the distinguishers shipping
_method
_id
and shipping
_address
_id
, to an output struct 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 the the four lineitems by vendor, to an output struct called _Vendors, a simplelist of dictionaries will be on your orderform 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
Setting Up the Pipeline and Cache
Adding Shipping Methods and Components