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.

  • Danzig 32 posts 52 karma points
    May 19, 2011 @ 08:04
    Danzig
    0

    Retrieve order details for email confirmation

    Hi

    I've read this guide for setting up email sending and editing content: http://www.publicvoid.dk/SendingEmailUsingUCommerce.aspx

    But so far I can't seem to get the order ID, or any other order details, into the confirmation email.  I haven't set anywhere for uCommerce to supply the order ID in querystring to the confirmation content page.  I'm not sure if this happens automatically, but if not then I need to know how to do that.  

    The guide says, "By use of a little magic uCommerce will provide the content page with a query string parameter named “orderNumber”, which will give you context information to load data.".  But I can't see where to configure that.

    Help appreciated!

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 19, 2011 @ 11:44
    Søren Spelling Lund
    0

    Hi Danzig,

    The SendEmailTask in the checkout pipeline is responsible for sending the order confirmation. It will pick up the order number from the order being checked out and call the EmailService, which in turn requests the configured template in the e-mail system with the orderNumber parameter.

    To get at it you can use the

    <xsl:variable name="orderNumber" select="umbraco.library:RequestQueryString('orderNumber')"/>

    There should be no need to do anything else. You can specify additional parameters if you call the EmailService class directly, but for this scenario the default seems to be just what you need.

  • Tony Kiernan 278 posts 341 karma points
    Jul 12, 2011 @ 17:31
    Tony Kiernan
    0
    <xsl:variablename="orderNumber"select="umbraco.library:RequestQueryString('orderNumber')"/>

    Trying to do this in Razor

    var orderNumber = umbraco.library.RequestQueryString("orderNumber");

    Am I on the wrong track here, again?

  • Tony Kiernan 278 posts 341 karma points
    Jul 13, 2011 @ 13:05
    Tony Kiernan
    0

    OK

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

    What next? I'd imagine that I just loop through that like with the basket. Seemingly not.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 28, 2011 @ 17:39
    Søren Spelling Lund
    0

    Hi Tony,

    GetPurchaseOrderByGuid will produce an XML view of the order, which is perfect for working with XSLT macros. The var keyword indicates that you're working with Razor, so you probably want to try this instead:

    var orderGuid = umbraco.library.RequestQueryString("orderNumber");
    var purchaseOrder = PurchaseOrder.All.Single(x => x.OrderGuid == orderGuid);
    foreach (OrderLine orderLine in purchaseorder.OrderLines)
    // output order line to customer. 
  • Kenny Burns 173 posts 305 karma points
    Mar 26, 2012 @ 13:14
    Kenny Burns
    0

    Hi Guys,

    Just a quick update on Sorens code above in case anyone else needs it (was missing a cast to Guid) :

    var orderGuid = new Guid(umbraco.library.RequestQueryString("orderGuid"));
     var purchaseOrder = PurchaseOrder.All().Single(x => x.OrderGuid == orderGuid);
        foreach (OrderLine orderLine in purchaseOrder.OrderLines){
            // output order line to customer. 
        }
  • Søren Spelling Lund 1797 posts 2786 karma points
    Mar 29, 2012 @ 15:04
    Søren Spelling Lund
    0

    Thanks for adding that note. I should really avoid coding in Notepad :)

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jun 27, 2012 @ 17:42
    Simon Dingley
    0

    Just to clarify for the benefit of others who may end up here like me looking for the querystring parameter passed to the email node, it is orderNumber and NOT orderGuid as indicated in one of the above posts and in a couple of other places I have seen on my travels.

  • Roger 14 posts 34 karma points
    Jul 24, 2013 @ 05:30
    Roger
    0

    I seem to be having a problem with

    <xsl:variable name="cart" select="CommerceLibrary:GetPurchaseOrder($orderGuid)"/>

    When I try to add this to my xslt file I get this

    System.ArgumentException: The purchase order with order number '' could not be found. 
    at UCommerce.Transactions.TransactionLibraryInternal.GetPurchaseOrder(String orderNumber, Boolean validateForCurrentMember) 
    at Castle.Proxies.TransactionLibraryInternalProxy.GetPurchaseOrder_callback(String orderNumber, Boolean validateForCurrentMember) 
    at Castle.Proxies.Invocations.TransactionLibraryInternal_GetPurchaseOrder.InvokeMethodOnTarget() 
    at Castle.DynamicProxy.AbstractInvocation.Proceed() 
    at UCommerce.Infrastructure.Interceptor.ExceptionLoggingInterceptor.Intercept(IInvocation invocation) 
    at Castle.DynamicProxy.AbstractInvocation.Proceed() 
    at Castle.Proxies.TransactionLibraryInternalProxy.GetPurchaseOrder(String orderNumber, Boolean validateForCurrentMember) 
    at UCommerce.Xslt.LibraryImpl.GetPurchaseOrder(String orderNumber) 
    at UCommerce.Xslt.Library.GetPurchaseOrder(String orderNumber)

     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
     
     
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
    version="1.0" 
     
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Examine="urn:Examine" xmlns:ucomponents.cms="urn:ucomponents.cms" xmlns:ucomponents.dates="urn:ucomponents.dates" xmlns:ucomponents.email="urn:ucomponents.email" xmlns:ucomponents.io="urn:ucomponents.io" xmlns:ucomponents.media="urn:ucomponents.media" xmlns:ucomponents.members="urn:ucomponents.members" xmlns:ucomponents.nodes="urn:ucomponents.nodes" xmlns:ucomponents.random="urn:ucomponents.random" xmlns:ucomponents.request="urn:ucomponents.request" xmlns:ucomponents.search="urn:ucomponents.search" xmlns:ucomponents.strings="urn:ucomponents.strings" xmlns:ucomponents.urls="urn:ucomponents.urls" xmlns:ucomponents.xml="urn:ucomponents.xml" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:CommerceLibrary="urn:CommerceLibrary" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch" 
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ucomponents.cms ucomponents.dates ucomponents.email ucomponents.io ucomponents.media ucomponents.members ucomponents.nodes ucomponents.random ucomponents.request ucomponents.search ucomponents.strings ucomponents.urls ucomponents.xml umbraco.contour CommerceLibrary PS.XSLTsearch ">
     
     
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:variable name="orderGuid" select="umbraco.library:RequestQueryString('orderGuid')"/>
    <xsl:variable name="cart" select="CommerceLibrary:GetPurchaseOrder($orderGuid)"/>
    <xsl:param name="currentPage"/>
    <xsl:template match="/">
     
     
    <xsl:value-of select="$orderGuid"/>
     
     
    </xsl:template>
     
    </xsl:stylesheet>

    If I leave it out I can get the orderGuid in an email. What am I doing wrong? 

Please Sign in or register to post replies

Write your reply to:

Draft