Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Tony Kiernan 278 posts 341 karma points
    Sep 07, 2011 @ 16:26
    Tony Kiernan
    0

    Show shipping method in basket

    Can anyone help with this?  Using razor.  I can't even work out where to start.  Assumed that a purchase order would have a ShippingMethodId I could work from

  • Tony Kiernan 278 posts 341 karma points
    Sep 07, 2011 @ 17:34
    Tony Kiernan
    0
    @using UCommerce.EntitiesV2;
    
    Basket basket = SiteContext.Current.OrderContext.GetBasket();
    
    int orderID = basket.PurchaseOrder.OrderId;
    Shipment shipper = Shipment.All().Single(sh => sh.OrderId == orderID);
    string method = shipper.ShipmentName.ToString();

    This works. Better methods welcomed

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 08, 2011 @ 14:24
    Søren Spelling Lund
    0

    You can also use

    var shipments = basket.Purchase.Shipments;

    or in XSLT

    the <shipments> element will contain the pertinent information.

  • Tony Kiernan 278 posts 341 karma points
    Sep 08, 2011 @ 15:14
    Tony Kiernan
    0

    I'm assuming that's

    basket.PurchaseOrder.Shipments;

    So how would I access the shipment name?

  • Tony Lorentzen 85 posts 174 karma points
    Sep 08, 2011 @ 16:32
    Tony Lorentzen
    0

    Did you try:

    basket.PurchaseOrder.Shipments(0).Name

    Tony

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 12, 2011 @ 15:16
    Søren Spelling Lund
    0

    basket.PurchaseOrder.Shipments.First() will return the first shipments. You probably want to loop over the shipments and display their attached order lines if you're working with multiple shipments. For single shipment scenarios First() will work nicely.

Please Sign in or register to post replies

Write your reply to:

Draft