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.

  • Troels Larsen 75 posts 280 karma points
    Mar 10, 2014 @ 15:02
    Troels Larsen
    0

    Getting shipping information in order Email

    Hey uCommerce team 

    In my Order confirmation email i need to access the shipping information but the method takes a string of name ? 

    what i do is : 

    PurchaseOrder Order = PurchaseOrder.FirstOrDefault(x => x.OrderGuid.ToString() == orderGuid); Order.GetBillingAddress();
    Order.GetShippingAddress("what to define here");

    GetBillingAddress works like a charm but my shipping address is not showing.

    Any hints ? 

    Regards Troels Larsen

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Mar 10, 2014 @ 15:18
    Nickolaj Lundgreen
    100

    Hey Troels

    The string is the shipping "alias" or name. I would use the following code to get all the shippingAddresses:

    var test = PurchaseOrder.All().FirstOrDefault();
    foreach (var shipment in test.Shipments)
    {
        var address = shipment.ShipmentAddress;
    }
    

    Or hardcode the shipment name you are looking for - you can find it in the uCommerce_Shipment table in the database (under ShipmentName)

    (there might be some small errors, don't have an uCommerce database right here)

    Best regards

  • Troels Larsen 75 posts 280 karma points
    Mar 11, 2014 @ 13:33
    Troels Larsen
    0

    Thx Nickolaj 

    Works like a charm.

Please Sign in or register to post replies

Write your reply to:

Draft