Setting the Default Label FormatEnter Code to Include Order Number, Tracking Number, and Shipping Cost
Or
Background
With ShipWorks it is possible to modify your label template (the template used to print your labels) to accommodate printing to 4" x 8" label stock. You can also modify the label to include additional information such as a tracking number, ship date, label cost, or even your logo.
This is useful when you have label stock that includes a doc tab on which additional information needs to be printed or if you wish to add branding to your shipping labels.
This article will guide you through how to:
1. Create a 4" x 8" label template.
2. How to include additional information on the label.
- Order Number, Tracking Number, and Label Cost
- OR Your Logo
First Things First
The instructions below will work for any shipping provider that you may use. We will be using FedEx in this example. In addition, this article assumes that:
- You are using 4" x 8" label stock that includes either space above the printed label or a doc tab above the printed label.
- You're printing to a thermal printer
- Your thermal printer is connected to your computer and you have successfully printed a test page to the printer.
The Process
Creating the Template
The first step is configuring the template that you will use to print your labels. You will be creating a new template and adding code to the template that tells ShipWorks to include the Order Number, Tracking Number and Shipment Cost to the top of the printed label. (Don't worry, we give you the code below. You just copy and paste it!)
If you would rather print your logo on the top of your label, we will give you code for that too!
1. In ShipWorks, click on the Manage tab and then click on Templates.
2. In the Template Manager, click on the Labels > Standard template to select it.
3. Then, click the COPY button. and click OK.
4. You now have a copy of the ShipWorks Standard label template. If it is not selected, select it and then click the Edit button.
5. Rename the template. For our example we will name the template Standard 4x8.
6a. Great! Now it is time to add the code we need. At the top of the Template Editor, select the Code tab.
6b. Click anywhere within the code and then press CTRL + A on your keyboard to select all of the code. Then, press Delete on your keyboard. (Yes, we actually wish to delete all of the code!) You should now have a blank template like the screenshot below.
Enter Code to Include Order Number, Tracking Number and Shipping Cost
If you would rather include your logo to the top of the label, skip down to the section on Adding Code to Include Your Logo.
6c. Copy the below code by selecting it and pressing CTRL + C on your keyboard.
<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"> <xsl:variable name="pageFont" select="'font-family: Arial; font-size: 10pt;'" /> <html> <head> <title>Interapptive ShipWorks Template</title> <style> body, table { <xsl:value-of select="$pageFont" /> } </style> </head> <body style="{$pageFont}"> <!-- XXXXXXXXXXXXXXXXXXXX Go down to line 25 where you can pick and choose what you want in the template XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> <xsl:variable name="labels" select="(//Primary | //Supplemental)/Label[@orientation = 'tall']" /> <xsl:for-each select="$labels"> <TemplatePartition> <xsl:variable name="shipment" select="../../../.." /> <table width="100%" height="100"> <tr> <td valign="center;" style="text-align:center;"> Order # <xsl:value-of select="//Order/Number" /> <br /> Tracking Number:<xsl:value-of select="$shipment/TrackingNumber" /> <br /> Shipping Cost: $<xsl:value-of select="format-number($shipment/TotalCharges,'#.##')" /> </td> </tr> </table> <img src="{.}" style="width:382; height:576;" /><br /> <br /> </TemplatePartition> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>
6d. In ShipWorks, on the Code tab, place your cursor into line 1 and press CTRL + V to paste the code into your template.
Perfect! Now, jump ahead to step 7a below.
Adding Code to Include Your Logo
Please Note: You will need to have your logo file available to you and formatted to the size you would like to have it appear on your label. You will be pointing to the image file in a moment.
If you would rather include the Order Number, Tracking Number and Shipment Cost, click here.
6c. Copy the below code by selecting it and pressing CTRL + C on your keyboard.
<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"> <xsl:variable name="pageFont" select="'font-family: Arial; font-size: 10pt;'" /> <html> <head> <title>Interapptive ShipWorks Template</title> <style> body, table { <xsl:value-of select="$pageFont" /> } </style> </head> <body style="{$pageFont}"> <!-- XXXXXXXXXXXXXXXXXXXX Go down to line 25 where you can pick and choose what you want in the template XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> <xsl:variable name="labels" select="(//Primary | //Supplemental)/Label[@orientation = 'tall']" /> <xsl:for-each select="$labels"> <TemplatePartition> <xsl:variable name="shipment" select="../../../.." /> <table width="100%" height="100"> <tr> <td valign="center;" style="text-align:center;"> <img src="imagelocation"></img> </td> </tr> </table> <img src="{.}" style="width:382; height:576;" /><br /> <br /> </TemplatePartition> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>
6d. In ShipWorks, on the Code tab, place your cursor into line 1 and press CTRL + V to paste the code into your template.
6c. Now, we need to point ShipWorks to the image file of your logo. Scroll down to line 31 of the code and find the code <img src="imagelocation"></img>.
6d. Replace imagelocation with the actual location of your logo image (be sure to leave the quotation marks in the code) :
- If your logo is on your computer's hard drive the code would like similar to this: <img src="C:\Users\JohnDoe\Pictures\logoimage.jpg"></img>
- If your logo is stored on the internet, the code would look similar to this: <img src="http://www.pictureexample.com/logoimage.jpg"></img>
- NOTE: If you use an image stored online and the URL includes any characters like &,=, or !, you might get an error. The template editor is an XSLT editor and processes these characters differently than an HTML editor. If you run into an error because a special character is in a URL, go to http://tinyurl.com/ and generate a URL without these characters and try again.
Note: You can test to see if your logo shows up on the template by clicking on the Preview tab. (Don't worry if it is not formatted properly, we will correct that in just a minute.)
Formatting the Template to 4" x 8"
7b. Click on the Custom Label Sheet button. Then, click New.
7c. On the Custom Label Sheet screen, name the sheet 4x8. Then, set the following options.
- Sheet Size: Custom
- Dimensions: 4.00 x 8.00
- Label Dimensions: 8.00 x 4.00
- Leave all other fields as the default settings.
7e. Click on the Choose button and select Custom > 4x8.
Selecting the Printer
Now we need to select the thermal printer to which you will have your labels print.
8. Still on the Template Editor screen, select the Settings tab and then Printing.
9. From the Printer: drop-down menu, select the thermal printer to which you wish to have your labels print. Note: The source may change automatically to say Manual. That's OK, this is normal.
10. Click Save. Then, click Close.
Set the Default Label Format to Standard
The template that we created in the above steps will only work with an image of the shipping label. So, we need to tell our shipping provider to send us a Standard label rather than a Thermal label. Here's how:
1. Click on the Manage tab and then the Shipping Settings button.
2. On the Shipping Settings screen, select the shipping provider for which you wish to print the 4x8 inch labels.
Note: For this example we will be using FedEx. The basics steps are the same for each shipping provider.
3. On the Settings tab, click on the blue link for Defaults - [provider name].
4. On the Shipping Profile screen scroll down, if needed, to the Labels section and select Standard as the Requested Label Format. Then, click OK.
Set the Default Print Rule
Next, we need to tell ShipWorks to print the label using the template we created.
1. Still on the Shipping Settings screen, click on the Printing tab.
2. In the Labels section, change the rule Otherwise Always print with Standard to Otherwise Always print with Standard 4x8.
3. Click the Close button.
Test Your Label
In order to see if your setup works, you will need to process a new label using the provider(s) you configured with your new 4" x 8" template. You cannot just reprint a thermal (ZPL or EPL) formatted label as these will not work with your new template.
Your printed labels should look like:
For labels with a logo:
Labels with Additional Information:
Still Need Help?
Please feel free to reach out to one of our awesome Customer Care Representatives in St. Louis. We are happy to help.