Shipping Rates.

We need to display the prices of shipping methods with the name of the method on our UI.

Is there a way to handle this

We do not want to run pipeline for each shipping method and compute the result and present it to user.

Thanks



Answer this question

Shipping Rates.

  • Greg Thomas - UK

    Hello David,

    ShippingMethodManager  is sealed and has no constructor. What do you recommend

    Thanks,

    Dmitry



  • TBing

    David,

    How can you use a class that is sealed and has no constructors or static methods.

    Am i missing something


  • FlashFan

    Joseph Johnson wrote:

    The ShippingMethodManager is available as a property on the OrderManagementContext. The OrderManagementContext is created using a static OrderManagementContext.Create method, which takes a site agent or a service agent.

    While it's not a cookie-cutter factory pattern, I think that's the architecture that best describes instantiating the ShippingMethodManager/OrderManagementContext.

    OrderManagementContext omc = OrderManagementContext.Create(http://localhost/OrdersWebService/OrdersWebService.asmx);
    omc.ShippingMethodManager. //You now have access to your site's shipping method manager.



  • smudie

    The ShippingMethodManager a sealed class has no public constructors and no static methods, how do we use it to get the shipping rates

    Is there any other way through the API's to get to the shipping rate.

    Thanks


  • Solitaire

    msdate,

    The ShippingMethodManager is available as a property on the OrderManagementContext. The OrderManagementContext is created using a static OrderManagementContext.Create method, which takes a site agent or a service agent.

    You should not use this context in a runtime web-app, as it's going to load up the site configuration everytime that it's instantiated (which is something that the Best Practices Analyzer recommends against).

    You can also get the shipping methods into a dataset using this method:

    Microsoft.CommerceServer.Runtime.CommerceContext.Current.OrderSystem.GetShippingMethods()



  • leodippolito

    msdate,

    Note that GetShippingMethods() returns the shipping rate tables that StepWiseShipping methods use...not the calculated shipping rate. To calculate the shipping rate you will need to perform a shipping rate calculation. You can either write your own non-pipeline-method or execute a pipeline that calculates shipping rates.

    Andy



  • osamaT

    We have many ways to get the shipping method, but no way to get to the shipping rate details of a method, meaning the quantity, increment and amount from the shipping rates.

    The costcalculator is useless unless we get the above fields.

    Thanks


  • Igor Solodovnikov

    To get the details of the shipping rate method, you will need to get a ShippingMethod using the ShippingMethodManager. The rate details are stored in ShippingMethod.ShippingRates. As mentioned above doing this in a runtime app is not recommended.

    -David


  • Business Intelligence Analyst

    Are you looking to provide specific pricing based on shopping cart contents or general pricing

    If general you can pull the rates through the ShippingMethodManager class using an OrderManagementContext.

    If you need specific rates you will need to run the pipeline. You could consider creating a specific pipeline to calculate shipping rates.

    Cheers,
    Colin



  • Shipping Rates.