Code:
<?xml version="1.0" standalone="yes" ?>
<package version="2.1" displayname="TrustedStore" debug="false" includeentityhelper="false">
<query name="Order" rowElementName="OrderInfo">
<sql>
<![CDATA[
select o.*, (case when o.AffiliateID = 0
then 'None' else (select a.Name from dbo.Affiliate a with (NOLOCK) where a.AffiliateID = o.AffiliateID) end) as AffiliateName From dbo.orders o with (NOLOCK)
where o.ordernumber = @ordernum
]]>
</sql>
<queryparam paramname="@ordernum" paramtype="request" requestparamname="ordernumber" defvalue="0" sqlDataType="int" validationpattern="^\d{1,9}$"/>
</query>
<query name="OrderItems" rowElementName="Item">
<sql>
<![CDATA[
SELECT s.ShoppingCartRecID,
s.OrderNumber,
s.ProductID,
s.VariantID,
s.Quantity,
s.ChosenColor,
s.ChosenSize,
s.OrderedProductName,
s.OrderedProductVariantName,
s.OrderedProductSKU,
s.OrderedProductPrice,
s.OrderedProductRegularPrice,
s.OrderedProductSalePrice,
s.OrderedProductExtendedPrice,
s.OrderedProductQuantityDiscountName,
s.OrderedProductQuantityDiscountID,
s.OrderedProductQuantityDiscountPercent,
s.IsShipSeparately,
s.IsDownload,
s.FreeShipping,
s.TextOption,
s.ShippingMethod,
s.Notes,
s.ExtensionData,
s.CustomerEntersPrice,
s.GiftRegistryForCustomerID,
s.ShippingAddressID,
s.ShippingDetail,
s.SizeOptionPrompt,
s.ColorOptionPrompt,
s.TextOptionPrompt,
s.IsTaxable,
s.TaxClassID,
s.TaxRate,
ISNULL(s.IsAKit, 0) AS IsAKit,
ISNULL(s.IsAPack, 0) AS IsAPack,
ISNULL(s.IsSystem, 0) AS IsSystem
FROM dbo.Orders_ShoppingCart s WITH (NOLOCK)
WHERE s.ordernumber = @ordernum
ORDER by s.ShippingAddressID
]]>
</sql>
<queryparam paramname="@ordernum" paramtype="request" requestparamname="ordernumber" defvalue="0" sqlDataType="int" validationpattern="^\d{1,9}$"/>
</query>
<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:variable name="OrderNumber" select="/root/Order/OrderInfo/OrderNumber" />
<xsl:template match="/">
<xsl:if test="/root/Runtime/PageName <> 'orderconfirmation.aspx'">
<!-- BEGIN: Google Trusted Store -->
<script type="text/javascript">
var gts = gts || [];
gts.push(["id", "XXXX"]);
gts.push(["google_base_offer_id", "<xsl:value-of select="aspdnsf:GetMLValue(ProductID)" disable-output-escaping="yes"/>"]);
gts.push(["google_base_subaccount_id", "XXXXXXX"]);
gts.push(["google_base_country", "US"]);
gts.push(["google_base_language", "en"]);
(function() {
var scheme = (("https:" == document.location.protocol) ? "https://" : "http://");
var gts = document.createElement("script");
gts.type = "text/javascript";
gts.async = true;
gts.src = scheme + "www.googlecommerce.com/trustedstores/gtmp_compiled.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gts, s);
})();
</script>
<!-- END: Google Trusted Store -->
</xsl:if>
<xsl:if test="/root/Runtime/PageName = 'orderconfirmation.aspx'">
<!-- BEGIN: Google Trusted Store -->
<script type="text/javascript">
var gts = gts || [];
gts.push(["id", "9810"]);
gts.push(["google_base_offer_id", "<xsl:value-of select="aspdnsf:GetMLValue(ProductID)" disable-output-escaping="yes"/>"]);
gts.push(["google_base_subaccount_id", "1565646"]);
gts.push(["google_base_country", "US"]);
gts.push(["google_base_language", "en"]);
(function() {
var scheme = (("https:" == document.location.protocol) ? "https://" : "http://");
var gts = document.createElement("script");
gts.type = "text/javascript";
gts.async = true;
gts.src = scheme + "www.googlecommerce.com/trustedstores/gtmp_compiled.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gts, s);
})();
</script>
<!-- END: Google Trusted Store -->
<!-- START Trusted Stores Order -->
<div id="gts-order" style="display:none;">
<!-- start order and merchant information -->
<span id="gts-o-id"><xsl:value-of select="$OrderNumber" /></span>
<span id="gts-o-domain">www.revgenetics.com</span>
<span id="gts-o-email"><xsl:value-of select="/root/Order/OrderInfo/Email" /></span>
<span id="gts-o-country"><xsl:value-of select="/root/Order/OrderInfo/BillingCountry" /></span>
<span id="gts-o-currency">USD</span>
<span id="gts-o-total"><xsl:value-of select="format-number(/root/Order/OrderInfo/OrderTotal, '0.00')" /></span>
<span id="gts-o-discounts">0.00</span>
<span id="gts-o-shipping-total"><xsl:value-of select="format-number(/root/Order/OrderInfo/OrderShippingCosts, '0.00')" /></span>
<span id="gts-o-tax-total"><xsl:value-of select="format-number(/root/Order/OrderInfo/OrderTax, '0.00')" /></span>
<script type="text/javascript">
var d1=new Date();
dl.setDate(dl.getDate() + 7);
document.write("<span id="gts-o-est-ship-date">"+d1.toString('yyyy-MM-dd')+"</span>");
//<span id="gts-o-est-ship-date">d1.toString('yyyy-MM-dd');</span>
</script>
<span id="gts-o-has-preorder">N</span>
<span id="gts-o-has-digital">N</span>
<!-- end order and merchant information -->
<xsl:apply-templates select="/root/OrderItems/Item" />
</xsl:if>
</xsl:template>
<xsl:template match="Item">
<xsl:if test="/root/Runtime/PageName = 'orderconfirmation.aspx'">
<span class="gts-item">
<span class="gts-i-name"><xsl:value-of select="OrderedProductName" /></span>
<span class="gts-i-price"><xsl:value-of select="OrderedProductPrice" /></span>
<span class="gts-i-quantity"><xsl:value-of select="Quantity" /></span>
<span class="gts-i-prodsearch-id"><xsl:value-of select="ProductID" /></span>
<span class="gts-i-prodsearch-store-id">XXXXXXX</span>
<span class="gts-i-prodsearch-country">US</span>
<span class="gts-i-prodsearch-language">en</span>
</span>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
</PackageTransform>
</package>