User Guide
CyberCash SmartElement Reference 223
Populate [ListElement] with ship options from [Recordset] using
weight from [ShoppingCart]
This contract creates a dropdown list of ship options from a recordset containing
various ship methods from various carriers based on a single rate zone. The
recordset is built from a table that contains a specified zone from the carriers
shipping rate tables. These can be downloaded from the various carriers’ websites.
The recordset contains a weight column and corresponding ship costs for the zone
specified in the table.
After the contract executes, the dropdown list will display each available shipping
option. The corresponding value stores both the ship method and cost in a
delimited string of the form "ShipMethod:ShipCost." You can then use the "Use
[ShipList] data to update/insert in [ShipViaCol] and [ShipCostCol] of
[Recordset] when [button] is clicked" contract to store the list data in the Orders
database for both the ship method and cost in one step.
Note that this contract assumes you have a table or view created that includes the
column for the specified zone for each of the ship methods you offer. See
DrumNote_510 for a detailed example.
Parameters:
Prompt is the string that appears at the top of the list to prompt a selection.
UsePrompt toggles whether a prompt is used in the list element.
WeightCol is the name of the column in the recordset participant that holds
the value for the order weight.
Participants:
ShoppingCart
Recordset
ListElement dropdown list
Populate [ListElement] with ship options from [Recordset] using
[ShoppingCart] weight and ship zone based on data from
[CustRS]
Extends the "Populate [ListElement] with ship options from [Recordset] using
weight from [ShoppingCart]" contract to allow for an alternate ship zone if the
customer's ship state is in the list of states specified in the 'StateList' parameter.
This allows you to set a default ship zone for most users, but gives the flexibility to
apply a different ship zone rate for some customers in certain states where
shipping might be more expensive.