Area: Episerver Commerce
Applies to versions: 10 and higher
Other versions:

Shipping methods

A shipping method manages information and rules that determine shipping cost and displays that information on the front-end site during checkout. The shipping cost is added to the total purchase price.

A shipping method is mapped to a Shipping Provider, visible to a back-end administrator in Commerce Manager. So, the public site can display friendly names (such as Ground Shipping), which are mapped to a provider, such as UPS. If a customer picks Ground Shipping, UPS is used.

See Shipping Gateways and Providers for information about creating gateways and providers.

Classes in this topic are available in the Mediachase.Commerce.Orders.Dto namespace.

How it works

  • To add a configuration tab for a shipping providers, create a new .ascx called ConfigureShippingMethod.ascx.
  • This .ascx uses the same inheritance and interface as the shipping provider.
  • The parameter settings for shipping methods are stored in the ShippingMethodParameter table.
  • See the ConsoleManager\Apps\Order\Shipping\Plugins\ WeightJurisdiction\ConfigureShippingMethod.ascx for an example of this.

    Note: This implementation uses AJAX to update the DTO, as the data occurs prior to the SaveChanges method being called.

Adding a shipping method parameters tab

You can store and retrieve information in the following ways.

  • Using the ShippingMethodParameter table

    The ShippingMethodParameter table lets you store name/value pairs for settings related to that shipping method.

  • Using the WeightJurisdiction provider

    You can store information in the format seen in the WeightJurisdiction provider, where each row of data represents the following, which is stored in the ShippingMethodCase table.

    • Total (representing the count or weight value)
    • Charge
    • JurisdictionGroupId
    • StartDate
    • EndDate for different shipping scenarios. 

Accessing shipping information

The following example shows how to display shipping methods to users and the respective rates for each, based on the current cart.

To store information for a selected shipping method, use the LineItem properties. You do not need to create a shipment object, since the Cart Prepare workflow handles this.

Last updated: Oct 24, 2016