I have never used xslt before , just learning a bit for a project ucommerce which is written in xslt, i am having problems with sending email using xslt macro. Below is the code:
When the email is send , it shows the orderGuid , but i cant see the order total , though the total is there in the database, just need to know am i writing the correct statement to get thge ordertotal , i also tried $cart/@OrderTotal with no success , any suggestions or assistance will be highly appreciated , thanks
but whats the correct format of getting the parameters , like the cart have 6-7 values , for instance if i want order total , should i write something like <xsl:copy-of select="$cart/@OrderTotal"/>
You're on the right track - what Rik suggested was that you did a copy-of the $cart variable so you can see the XML returned in it - e.g., you''d get something like this:
Basic Query about parameters / variables
Hi ,
I have never used xslt before , just learning a bit for a project ucommerce which is written in xslt, i am having problems with sending email using xslt macro. Below is the code:
variables defined:
<xsl:variable name="orderGuid" select="umbraco.library:RequestQueryString('orderNumber')"/>
<xsl:variable name="cart" select="CommerceLibrary:GetPurchaseOrder($orderGuid)"/>
<table>
<tr>
<td><xsl:value-of select="$orderGuid"/></td>
<td><xsl:value-of select= "$cart/OrderTotal" /></td>
</tr> </table>
When the email is send , it shows the orderGuid , but i cant see the order total , though the total is there in the database, just need to know am i writing the correct statement to get thge ordertotal , i also tried $cart/@OrderTotal with no success , any suggestions or assistance will be highly appreciated , thanks
possibly you can use
<xsl:copy-ofselect="$cart"/>
to output what data you have available?
but whats the correct format of getting the parameters , like the cart have 6-7 values , for instance if i want order total , should i write something like <xsl:copy-of select="$cart/@OrderTotal"/>
anyone ??
Hi Mr. A,
You're on the right track - what Rik suggested was that you did a copy-of the $cart variable so you can see the XML returned in it - e.g., you''d get something like this:
So $cart points to the <cart> element, and to get the values out, you use simple "paths" - the simplest blocks of the XPath language:
So to get the value of an element, use its name - to get the value of an attribute, use its name prefixed with an at-sign (@).
(So copy-of gives you the actual elements - value-of gives you the string values)
/Chriztian
is working on a reply...