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.
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.
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.
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.
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.
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)
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!
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
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.
Trying to do this in Razor
Am I on the wrong track here, again?
OK
What next? I'd imagine that I just loop through that like with the basket. Seemingly not.
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:
Hi Guys,
Just a quick update on Sorens code above in case anyone else needs it (was missing a cast to Guid) :
// output order line to customer.
Thanks for adding that note. I should really avoid coding in Notepad :)
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.
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)
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
</xsl:template>
</xsl:stylesheet>
If I leave it out I can get the orderGuid in an email. What am I doing wrong?
is working on a reply...