How to import tracking label numbers into Woocommerce orders

For everything that Woocommerce offers it still lacks one important feature. The ability to scan and import tracking numbers from shipping labels. But with this post I’ll show you how you can quickly add shipping numbers to Woocommerce orders with a barcode scanning app.

For this to work you’re going to need the following WordPress plugins

  • Woocommerce order barcodes
  • WP All import pro
  • WP All import Woocommerce extension
  • Woocommerce pdf invoices and packing slips (optional)
  • Aftership Woocommerce tracking (optional)

In addition to those plugins you’re going to need the following mobile apps

  • Android and iOS: Barcode to sheet

First, begin by installing each of the plugins and apps. Most of the plugins are premium plugins so it might not be worth following this guide if you only ship half a dozen items a day.

Once all of the plugins have been installed we need to do a little code editing or optionally add a shortcode to a page.

Go to your file manager or FTP client and navigate to wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple and copy it to your (child) theme in wp-content/themes/shopkeeper/woocommerce/pdf/yourtemplate 

Next open packing-slip.php and scroll to the bottom of the file. Enter the following line of code

<?php do_action( 'wpo_wcpdf_after_customer_notes', $this->type, $this->order ); ?>

/**
*** Enter the following line in this position
**/

<?php echo WC_Order_Barcodes()->display_barcode($order_id); ?>;
/*
** All done
*/

<?php if ( $this->get_footer() ): ?>;

Now create a new page and enter teh following shortcode into the page. This will allow you to generate the barcodes on the frontend of your website, but only administrators and shop managers will be able to access it.

[scan_barcode]

Next we need to open the app and create a sheet. Begin by hitting the at the bottom right.

Give the sheet a name in the first line

Name the first column Order then hit the

When the new column field appears name it tracking

Hit the save icon at the top right

Now the fun begins. If you are using the pdf packing slips plugin print the orders you need to ship and begin getting things ready. As you pack an order tap the order field and hit the middle button to scan the order barcode. Once it has scanned hit the same button again to scan the shipping label. Once done hit the button on the bottom right.

Start the next order and continue doing this until you have finished packing. Every order should have a shipping number and order number scanned.

Once all have been scanned tap on the three dots in the top right and email yourself the csv spreadsheet. 

Now head to your website and go to wp-all import and upload a new file.

Select the file

Select existing items

Select Woocommerce orders

Click continue to step 2

On the next screen make sure everything is correct in the fields. If they appear correct click next. The tracking barcode will probably have more numbers than is visible on the label, but this should be fine.

Click continue to step 3

The next screen will allow you to set the fields by simply dragging and dropping a shortcode from the floating widget on the right side of the screen.

In the order status change it to completed.

The next section is only relevant if you are using the aftership plugin. Your customer will still receive tracking information by way of order notes even if you don’t use aftership.

Go down and open the notes section. Enter something like Australia Post tracking : and then drag the tracking number shortcode to the end of the text. Select checkbox Note to customer

If you’re using aftership click the custom fields box and open it. Next click see detected fields. All of the custom fields in use will appear. Go down to the section where aftership is present. Shortcut using control F and search aftership.

In the section where it says _aftership_tracking_number drag the tracking number field over. Remove any row with a semicolon ; or simply delete all fields except for the aftership ones by clicking on the trash icon to the right of each row.

We’re now done on this page and can click continue to step 4

On this page we need to do the following

Highlight custom fields in the first section and in the first field enter _barcode_text

In the second field drag the order field to it

Uncheck Create new orders from records newly present in your file

Check Choose which data to update

Unselect all

Check the following

  • Order status
  • Customer notes
  • Order notes
  • Custom fields

In custom fields check Update only these Custom Fields, leave the rest alone

Next enter the following 3 fields one at a time and select them

_aftership_tracking_provider
_aftership_tracking_provider_name
_aftership_tracking_number

Click continue

On the final page you’ll see a large button that says Confirm and run import 

Click this button and it will import the file and update all of the orders for you. The process may take some time depending on the number of orders and the speed of the server.

Check the orders to confirm they have successfuly imported.

Written by John Cook
I've been using WordPress for over 6 years and Woocommerce for over 4 years. In that time I have explored the depths of customizations and helped many online retailers grow and expand their business using the Woocommerce selling platform. My aim here is to help enable Woo users around the globe get even more out of their e-commerce platform of choice.