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
    Jul 20, 2011 @ 10:29
    Tony Kiernan
    0

    Order details in Email for Razor

    Picking up the orderGuid, and (I think) creating a purchase order.  But I cannot work out how to loop through these to build full order details in the confimation the order details in the confirmation email.

    var orderGuid = umbraco.library.RequestQueryString("orderNumber");
    var basket = Library.GetPurchaseOrderByGuid(orderGuid);

    Can anyone direct me to my next step?

  • Anders Lund 17 posts 38 karma points
    Jul 20, 2011 @ 10:44
    Anders Lund
    0

    Hi Tony

    Funny - i am working on the exact same thing right now :-)

    If you are using Razor i would recommend you to use something like the following piece of code:

    @using UCommerce.EntitiesV2

    @{
    PurchaseOrder order = PurchaseOrder.SingleOrDefault(x => x.OrderGuid == new Guid(umbraco.library.RequestQueryString("orderNumber")));

    @Html.Raw(order.OrderNumber)
    <br/>
    @Html.Raw(order.Customer.FirstName)
    <br/>
    @Html.Raw(order.Customer.LastName)
    }

    Then you can access all the properties of the order at hand.

    Did it make the trick for you?

  • Tony Kiernan 278 posts 341 karma points
    Jul 20, 2011 @ 10:58
    Tony Kiernan
    0

    It most certainly is!  Thank you

    For other idiots like me, the loop is:

        foreach (OrderLine line in order.OrderLines){}
  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 28, 2011 @ 17:17
    Søren Spelling Lund
    0

    Thanks for helping out, Anders. Much appreciated!

Please Sign in or register to post replies

Write your reply to:

Draft