Edit code for printing template
Hello, I am trying to combine two codes for our thermal shipping labels. Basically, We want our logo at the top, centered, and we need the SKU of the item sold at the bottom so we know what to pack. We have both of these codes separately, but I do not know how to combine them... Can anyone help? The codes are below
FOR THE LOGO AT THE TOP:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">
<!-- Imports -->
<xsl:import href="System\Snippets" />
<xsl:output method="html" encoding="utf-8" />
<!-- Start of template -->
<xsl:template match="/"><xsl:apply-templates /></xsl:template>
<xsl:template match="ShipWorks">
<html>
<head>
<title>Interapptive ShipWorks Template</title>
</head>
<body>
<xsl:variable name="labels" select="(//Primary | //Supplemental)/Label[@orientation = 'tall']" />
<xsl:for-each select="$labels">
<xsl:variable name="shipment" select="../../../.." />
<TemplatePartition>
<table height="0%" width="0%" cellspacing="0">
<tr valign="top" style="height: 1in;">
<td valign="" align="center">
<img src="dce40b58.jpg" importedFrom="Thermal Logo.jpg" shipworksid="3060651030" />
</td>
</tr>
<tr valign="top" style="height: 1in;">
<td valign="top" align="">
<xsl:choose>
<xsl:when test="$shipment/ShipmentType = 'FedEx'">
<img src="{.}" style="width:384; height:576;" />
</xsl:when>
<xsl:when test="$shipment/ShipmentType = 'UPS'">
<img src="{.}" style="width:384; height:576;" />
</xsl:when>
<xsl:otherwise>
<img src="{.}" style="width:{@widthInches}in; height:{@heightInches}in;" />
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</table>
</TemplatePartition>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
FOR THE SKU AT THE BOTTOM:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">
<!-- Imports -->
<xsl:import href="System\Snippets" />
<xsl:output method="html" encoding="utf-8" />
<!-- Start of template -->
<xsl:template match="/"><xsl:apply-templates /></xsl:template>
<xsl:template match="ShipWorks">
<html>
<head>
<title>Interapptive ShipWorks Template</title>
</head>
<body>
<xsl:variable name="couponCode" select="'LOYALTY'" />
<xsl:variable name="couponAmount" select="'10%'" />
<xsl:variable name="couponValidDate" select="'outdoorsupplyinc.com'" />
<xsl:variable name="order" select="//Order" />
<xsl:variable name="labels" select="(//Primary | //Supplemental)/Label[@orientation = 'tall']" />
<xsl:for-each select="$labels">
<xsl:variable name="shipment" select="../../../.." />
<TemplatePartition>
<xsl:choose>
<xsl:when test="$shipment/ShipmentType = 'FedEx'">
<img src="{.}" style="width:384; height:576;" />
</xsl:when>
<xsl:when test="$shipment/ShipmentType = 'UPS'">
<img src="{.}" style="width:384; height:576;" />
</xsl:when>
<xsl:otherwise>
<img src="{.}" style="width:384; height:576;" />
</xsl:otherwise>
</xsl:choose>
<table>
<xsl:for-each select="$order/Item">
<!-- We shouldn't have to conditionally apply the topborder... but IE is broken. -->
<xsl:variable name="orderDetailContentStyle">
padding: 4px 8px 4px 8px;
<xsl:if test="position() != 1">border-top: 1px solid lightgrey;</xsl:if>
</xsl:variable>
<tr>
<td style="{$orderDetailContentStyle};">
<xsl:value-of select="SKU" />
</td>
<td style="{$orderDetailContentStyle};" align="right">
<xsl:value-of select="Quantity" />
</td>
</tr>
<tr>
<td colspan="2" style="{$orderDetailContentStyle};">
<xsl:for-each select="Option"><font size="2">
<xsl:value-of select="Name" />: <xsl:value-of select="Description" /> </font>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
<table style="border-collapse:collapse;border-spacing: 0">
<tr>
<td style="font-size:12;width:50%">
<div style="margin:0 0 0 10">
We are committed to providing a 5 <br />star buying experience. If you have<br /> any
questions or concerns about<br /> your order, please call or email us. <br />We're here to help.<br />
(888)309-7446
happy@outsup.com
</div>
</td>
<td style=" background:white;text-align:center">
<font color="black" size="2">
Exclusive Offer for You!<br />
<table cellpadding="2 0 2 0" style="border-collapse:collapse;border-spacing:0;">
<tr>
<td><font color="black" size="2">SAVE</font></td>
<td style=" background:white;text-align:center"><font color="black" size="5"><xsl:value-of select="$couponAmount" /></font></td>
</tr>
<tr>
<td><font color="black" size="3">Use Code</font></td>
<td><font color="black" size="5"><xsl:value-of select="$couponCode" /></font></td>
</tr>
</table>
<font color="black" size="2">
When you order on our website <xsl:value-of select="$couponValidDate" />
</font>
</font>
</td>
</tr>
</table>
</TemplatePartition>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Please sign in to leave a comment.
Comments
1 comment