Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sunnefa 22 posts 41 karma points
    Sep 30, 2015 @ 10:48
    Sunnefa
    0

    Show chosen shipping method on overview

    Hi! Thanks for a great package, we have used it effectively a couple of times already but we are now for the first time implementing a basket and checkout process.

    I have already discovered how I can list the shipping methods available, although I feel I must point out that finding information about that was not easy. The customer can choose a shipping method and the next page they go to shows an overview of their order.

    Now my question is, how can I show which shipping method they chose? The basket does not seem to have any GetSavedShippingQuote kind of method although it does have a SaveShipmentRateQuote method so it must be possible to retrieve which method has been saved, so how to go about it?

    Any help would be greatly appreciated, thanks!

  • Eidos 44 posts 66 karma points
    Oct 05, 2015 @ 07:36
    Eidos
    0

    I found a way (maybe it is not a good solution):

    IBasket basket = customerContext.CurrentCustomer.Basket();    
    IBasketSalePreparation basketSalePreparation = basket.SalePreparation();
    IInvoice invoice = basketSalePreparation.PrepareInvoice();
    if (invoice != null)
    {
       ILineItem itemShipping = invoice.Items.Where(x => x.LineItemType == Merchello.Core.LineItemType.Shipping).FirstOrDefault();
       if (itemShipping != null)
       {
          return itemShipping.ExtendedData.GetShipMethodKey();
       }
    }
    

    Is there another way to accomplish that?

Please Sign in or register to post replies

Write your reply to:

Draft