The DefaultShopperInfo component, which usually appears in the Shopper Information stage of an order processing pipeline, retrieves the values stored in the Pipe Context’s Shopper Dictionary, creates corresponding entries in the OrderForm’s order
Dictionary, and initializes these new entries to contain the values read from the Shopper Dictionary. The OrderForm entries written by DefaultShopperInfo are prefixed with _shopper
_, followed by the name of the entry in the Shopper Dictionary. Finally, the appropriate _shopper
entry is initialized to contain the corresponding value from the source Dictionary.
The following example, from the Volcano Coffee sample site, illustrates this operation.
When a customer of the Volcano Coffee site adds an item to his or her basket, the OrderFormPurchase function is called. This function, which is defined in the xt_orderform_purchase.asp file, retrieves a DBStorage object that represents shopper storage, and then uses that object to retrieve information on the current shopper:
REM Create a Storage object for the shopper information
Set mscsShopperStorage = UtilGetShopperStorage()
REM Get the shopper from the shopper storage
on error resume next
set mscsShopper = UtilGetShopper(mscsShopperStorage)
on error goto 0
The DBStorage object returned by UtilGetShopperStorage has been configured to query vc30_shopper table. The vc30_shopper table has the following structure.
The call to UtilGetShopper returns a Dictionary that contains all of the columns in this table for the current customer. Finally, the function calls the UtilGetPipeContext function to retrieve the pipe context, and explicitly initializes the Pipe Context’s Shopper name/value pair to reference the Dictionary returned by UtilGetShopper:
REM Create the basic pipe context
set mscsPipeContext = UtilGetPipeContext()
REM Add necessary data to the pipe context
set mscsPipeContext.Shopper = mscsShopper
After the pipe has been executed, the OrderForm contains the following name/value pairs:
order._shopper_shopper_id
order._shopper_created
order._shopper_name
order._shopper_password
order._shopper_street
order._shopper_city
order._shopper_state
order._shopper_zip
order._shopper_country
order._shopper_phone
order._shopper_email