Code to Display Shipping Methods for a Particular Language

You can use the ShippingMethodManager object to control how shipping methods are displayed on your site. Shipping methods are stored in the ShippingConfig table of the Commerce Server run-time database (for example, Retail_commerce). The general steps for using the ShippingMethodManager object are to first initialize the ShippingMethodManager object and then obtain a list of the supported shipping methods. To retrieve the list of supported methods you call the GetInstalledMethodList method, which generates a SQL query and returns an ADO recordset containing all of the shipping methods in the ShippingConfig table. You can obtain a list of shipping methods for a particular language by appending a WHERE clause to the query that specifies a language_id field. The filter parameter of the GetInstalledMethodList method provides the WHERE clause. The following code example illustrates this concept. The code generates the following SQL query:

SELECT shipping_method_id, shipping_method_name FROM ShippingConfig WHERE language_id= ‘en'
Dim oShipMgr
Dim rstShipInfo
Set oShipMgr = Server.CreateObject(“Commerce.ShippingMethodManager”)
rstShipInfo = oShipMgr.GetInstalledMethodList(“language_id=en”, “”, _
                                              Array(“shipping_method_id”,
                                              “shipping_method_name”))

Ee799765.note(en-US,CS.20).gifNote

  • The values for the language_id field are retrieved from the languages.xml file that is installed by default in the <bizdesk>\config directory.

See Also

International Shipping

ShippingMethodManager Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.