StepwiseShipping
Use this component in the multiple-shipment shipping architecture to calculate shipping costs for shipments. The StepwiseShipping component can handle charging for shipping by weight, by quantity, or by price.
Note
- This component should never be inserted directly in a pipeline; it is run by the ShippingMethodRouter component.
Configuration Values
The ShippingMethodRouter component sets the following value in the Configuration dictionary before executing the StepwiseShipping component.
Key | Description |
mode |
The shipping calculation mode. The options are:
0 Use subtotal to calculate shipping. 1 Use quantity to calculate shipping. 2 Use weight to calculate shipping. |
Values Read
The StepwiseShipping component reads the following values from the indicated dictionaries.
Key | Dictionary | Description |
TransactionConfigConnectionString |
Context | The data connection string to the database containing the shipping rates. |
shipments_to_process |
Context | A SimpleList object of the shipments to process. Each shipment is represented by a dictionary. |
The StepwiseShipping component also reads the following values for each item in each Shipment dictionary in the shipments_to_process
SimpleList object.
Key | Description |
_product_weight |
Optional. The weight of an individual item. Needed only if weight is used to calculate shipping. |
quantity |
Optional. The quantity of an individual item. Needed only if quantity is used to calculate shipping. |
_cy_oadjust_adjustedprice |
Optional. The subtotal for an item. Needed only if the subtotal is used to calculate shipping. |
Values Written
The StepwiseShipping component writes the following values to the Order dictionary.
Key | Description |
shipments._cy_shipping_total |
The shipping charges for each individual shipment. |
Remarks
The StepwiseShipping component goes through the list of shipments. For each shipment, it retrieves the shipping rate from the shipping rate table, and calculates the shipping according to the mode specified.
If you use weight to calculate shipping, all items must have a weight or the component returns an error.