Print order item labels

Following documentation is for WooCommerce DYMO Print version 3.0 or above.

Introduction

With WooCommerce DYMO Print version 3.0 we add the possibility to print labels for each purchased product (order items). To add order item labels you need to add some code to your theme functions.php or a custom plugin. Order item labels can be used for packaging purposes.

Example use

An online sandwich shop sells sandwiches to companies. A customer buys for all it’s colleagues sandwiches for lunch. There are a lot of different sandwiches in this purchase. 

The shop owner now can print order item labels for each purchased sandwich. The label contains the productname (what kind of sandwich it is), product price and some product information like ingredients.

Code example (snippet)

Back-up first! If you do something wrong, adding code to your functions.php can break your site!

To start printing order item labels you’ve to add the following code to your theme functions.php or a custom plugin.

What do you need to change in the code?

The key of the label. In the example: order-item (line 2).
The key must be unique and may not contain any spaces, numbers or special characters.

The name of the label. In the example: Order item (line 3).
The name is shown in the DYMO settings and on print buttons. Change it to whatever you want.

The color of the label icon. In the xample: #0033ff (line 4).
The color makes you recognize the label a lot easier. Use any HTML color. Don’t forget the hashtag (#).

The type of the label. In the example: order_item (line 5).
Use “order_item” for order item labels. Also allowed: order (for default labels).

Do not alter the filter name “wpf woocommerce dymo labels”, otherwise the filter becomes quite useless.

Label configuration

WooCommerce DYMO Print will show new settings as soon as a label with type “order_item” has been added.

It will add the following WooCommerce data to each object selectbox:

  • Order item SKU
  • Order item name
  • Order item quantity
  • Order item price
  • Order item line total
  • Order item line total incl. tax
  • Order item attributes
  • Order item url

You can combine normal order data with order item data on the same label.

Print label by quantity

There is also a new setting added called “Print label by quantity”. By changing this setting you can define how the purchase amount is handles to print order item labels.

This setting has two options:

  1. Yes: For each ordered product a label is printed. Product quantity is used.
    Example: If order item total is 5, 5 labels are printed.
  2. No: For each order item line a label is printed. Product quantity is ignored.
    Example: If order item total is 5, but order contains just 3 order item lines (unique product), 3 labels are printed.

Change label settings for order items

The following animation shows how we select WooCommerce data for order item labels. The label file in the animation is available from the Sample label page.

DYMO - change order item label settings

How to print

Order item labels can be printed in the same way as normal order labels.

You can print order item labels from the following places:

  • Order overview: Bulk actions
  • Order overview: Actions column
  • Order detail: metabox called “WooCommerce DYMO Print”

Click here for detailed instructions how to print labels.