PrintNode automatic printing for WooCommerce – documentation

PrintNode for WooCommerce – Documentation index

Questions applying to all our commercial WordPress plugins

How long do you provide access to new plugin releases and support for?

All plugin purchases come with included access to support and access to downloads for 12 months. After 12 months, you can renew access if you want to.

If you do not want to renew, then your existing plugin will not be de-installed or de-activated or changed in any other way. Of course, we cannot guarantee what level of compatibility it will have with future releases of WordPress or (if relevant) WooCommerce.

Do you have a trial version of your plugins available / what is your refund policy?

We do not have trial versions of our plugins available, or refund trial purchases. However, we are committed to providing support for any technical issues you have with any of our plugins, and all plugins include 12 months of support. If the plugin does not do what the product description says it does, then you can have a refund (this should be requested within 10 days of purchase), subject to allowing us to investigate the problem.

This policy specifically excludes third-party failures; for example, if a plugin depends upon a third-party service which malfunctions or closes down, you will not be eligible for a partial or full refund for the plugin purchase. It also explicitly excludes failed attempts by the customer to implement their customisations to the plugin. Refunds are not offered for “speculative” purchases where the customer is hoping that the software can do something which is not advertised; plugins are priced cheaply and you should check your requirements before purchase.

For EU customers, your right to a refund of digital goods that you have not requested a download of remain intact. You can request a refund of goods that have not yet been downloaded for up to 14 days after purchase. These requests will be verified using our download logs.

How can I download a PDF invoice/receipt for my purchase?

You can download a PDF invoice/receipt for plugins purchases from your account page, here.

How many licences should I buy?

You will need a separate licence for each WordPress installation which you wish to receive plugin updates (i.e. future releases), or to request support for.

A WordPress Network is a single installation of WordPress, so only requires one licence, regardless of how many blogs you have on the network.

What is your support and updates policy?

All customers will have access to future releases of the plugin, and for support to help with trouble-shooting, for 12 months.

Whilst we are happy to give general advice as part of support, support has reasonable limits. For example, hiring a developer (if one is available) to extend or customise the plugin for you, or trouble-shooting problems in other plugins on your site (or other things beyond scope – e.g. problems in your printer, or other third-party products), is not included in the purchase price.

Note that this does not affect your ability to continue using an installed plugin. Your installed plugins will remain installed forever. What is limited to 12 months is access to our future work on the plugin and support.

Can you write some code for me, to customise the plugin?

Plugin purchase prices do not include hand-written code, even if it is only a few lines.

At commodity prices, and including 12 months of updates to new versions (including compatibility with future releases of WordPress and (where relevant) WooCommerce), and personal support, the margins when selling plugins are small. As a result, plugin sellers rely upon selling to many customers – and personal customisations are not economic (even if potentially useful for other customers).

You are, of course, welcome to send in ideas for new features. If you need a developer to customise for you, though, then we suggest Codeable – https://codeable.io – where there is a large marketplace of WordPress and WooCommerce experts offering their services.

Where can I download my plugin purchase?

After purchasing one of our WordPress plugins, you can download from any of three or four places:

  1. The “thank you” page in your web browser, that appears immediately after completing payment.
  2. From your Simba account, here.
  3. Using the link in your order confirmation email.
  4. If you have already installed and begun using the plugin, you can obtain updates (when available) from the “Plugins” page in your WordPress dashboard.

How do I install my plugin?

If you’ve purchased one of our WordPress plugins, then thank you! Here’s how to install…

1. Go to the “Plugins” page in your WordPress dashboard, and press “Add New”

Add a new plugin

2. Press the “Upload Plugin” button

Upload a plugin

3. Press the button to select a zip file. Select the zip file for your plugin. Then press “Install Now”.

Uploading the zip file

4. When the plugin has uploaded, press the “Activate” button.
Activate

N.B. If you have the free version of any of our plugins (e.g. WooCommerce EU VAT Compliance, or Two Factor Authentication), then you should also de-activate and de-install the free version. Your settings will be retained by the paid version. It does not matter whether you de-activate and de-install before, or after, installing the paid version.

When buying a plugin, what is the difference between manual or automatic renewal?

All our plugins come with included access to personal support and updates (new versions of the software) for 12 months (more information). After this 12 months, you can keep on using the software, without any restrictions. However, if you want to renew, you can either do so manually (i.e. come back to the shop and make a fresh purchase) or automatically (i.e. an order will automatically be created and emailed to you, and payment taken if you have a payment method on your account). We offer a discount to those who choose automatic renewal. You can cancel a subscription at any time (yes, even 5 minutes after you purchased it).

Where can I see the plugin changelog?

For a plugin that you have purchased, the changelog is in the file “readme.txt” in the plugin zip.

For our current on-sale version (i.e. the latest version), you can see the changelog by going to the shop, and then going to the product page, and then clicking the link “Plugin changelog” from the left-hand side of the page.

How do I change which site is using a licence?

If you wish to stop using one of your plugin licences on one site, and instead use it on another, then do this:

1. Disconnect the “old” site.

Go to the “Plugins” page in the WordPress dashboard, and find the plugin’s entry. Press the “Disconnect” button.

Disconnecting

2. Connect the “new” site.

Go to the “Plugins” page in the WordPress dashboard on the new site, and connect.

Connecting

I have found a problem in the plugin, or a question not answered here. Where do I get personal support?

Please go here and open a support ticket. (Or, if you forgot your login details for your account with us, then please go here).

Is this plugin still supported and maintained?

Yes. If it ever stops being, then we would withdraw it from sale.


WooCommerce Automatic Order Printing (PrintNode)

What is PrintNode and how do I use it?

PrintNode (printnode.com) is a service for connecting your printers to the Internet, bringing a range of benefit such as the ability to print directly from a website and not being hindered by firewalls. This plugin uses PrintNode to automatically print new WooCommerce orders. You can begin using PrintNode for free by signing up at their website.

To use PrintNode, you need a printer and a computer that it is attached to (which can be almost anything – including Windows, Mac, Linux, Raspberry PI). Just sign up for an account, install their software on your computer, test it out, obtain your API key, and add it to the settings of our plugin.

What is the status of this plugin?

The code in this plugin is actively used and relied upon by many businesses across the world. It began life in the middle of 2013 (used on a take-away site running on WordPress 3.5 and WooCommerce 2.0, via Google Cloud Print). It has been continuously maintained and updated since then, being completely audited and re-engineered to work with PrintNode beginning in 2020. Since the first launch its code has been purchased for use with over a thousand live shops, running on all subsequent WordPress and WooCommerce versions.

How do I install this plugin?

This plugin is quite large (over 7Mb), because it contains a lot of code for creating PDF files. Normally, a plugin that you download can be installed and activated in your WordPress dashboard, in the Plugins -> Add New -> Upload page.

If your website gives you an error, telling you that you are not allowed to upload large files, then you can use either of these two methods instead:

  1. Go to the Plugins -> Add New page in your WordPress dashboard. Search for the plugin “Upload Larger Plugins”, and then install and activate it. Then return to the Plugins -> Add New -> Upload page, and try again.
  2. Or, unzip the plugin zip on your computer. You will then have a directory called “woocommerce-printnode”. Upload this whole directory via FTP into your WordPress plugins directory (wp-content/plugins). Then visit the Plugins page in your WordPress dashboard and activate the plugin.

How do I configure and use this plugin?

There are three things to do to being using this plugin, beyond installing and activating it:

  • Firstly, you need to set up your printer with PrintNode. You will need to a) open an account with them, on a free or paid plan, b) Download and install their software on the computer that is driving your printer, and test printing successfully through it from your account. To learn about how to do this, go to the PrintNode website. Come back to this documentation once you have successfully printed a test page to your printer from your account on the PrintNode website.
  • Secondly, you need to connect your website to PrintNode. In your WordPress dashboard, go to the WooCommerce -> PrintNode -> Settings page. Enter your PrintNode API key by following the instructions, and then save your settings. Then choose which printers you want to use in WooCommerce -> PrintNode -> Printers, and save your settings there also.
  • Thirdly, you need to choose which print-outs to send to PrintNode when an order is completed. This is done in your WordPress dashboard, in the WooCommerce -> PrintNode -> Settings page. You simply need to check all the boxes for all the print-outs which you wish. To customise the print-outs, follow the links shown (and see the section below).

Do you have a recommended printer, or list of compatible printers?

We do not have a particular recommended printer. PrintNode is designed to be compatible with any printer at all, because it is ultimately itself just a transport, getting a print job across the Internet, past firewalls, to your existing printer setup. It is unfortunately not economic for us to invest in testing different printers, given the pricing expectations of the WooCommerce extensions market.

So, any printer at all that you can connect to your computer and print from is suitable for use with this plugin. We are aware of customers successfully using a wide range of makes and models of printers, including different thermal printers.

We first tested and developed the first version of this plugin using (among other things) a Star TSP-100 thermal printer in 2013, and are aware of customers happily using this printer still today several years on, but this does not constitute a formal recommendation.

What other WooCommerce add-ons is this plugin compatible with?

We are not aware of any WooCommerce extensions that this plugin is not compatible with. If you find one that causes a problem, then please let us know. In particular, this plugin is compatible with WooCommerce Opening Hours (it displays the customer’s chosen delivery/collection time on its printouts), WooCommerce Invoices and Packing Slips by WP Overnight (options set in these plugins for your print-out layout will be honoured), WooCommerce Delivery Notes, WooCommerce Product Add-Ons from woocommerce.com (it displays the customer’s chosen choices in the print-out), and WooCommerce Currency Switcher by Aelia (the print-outs will use the proper currency symbols).

I am migrating from automatic order printing via your Google Cloud Print plugin – what do I need to do?

  1. Follow all instructions for the ordinary setup of this plugin.
  2. If you had any customisations applied via PHP code using WordPress action/filter hooks, then you will need to change the references of all these. The plugin uses similar names, but not identical ones. Please look in the other FAQs, and/or the plugin source code, to find the new names.

I have a payment method for which I want to print as soon as an order is placed

With our WooCommerce automatic order printing plugin (via PrintNode), for some payment methods (e.g. cash on collection, BACS transfer) it makes sense for the print-out to be done instantly on order creation, instead of (as for automated/electronic payment methods, e.g. PayPal, card payment) when payment has been made.

The plugin contains a default list of such payment methods. However, your WooCommerce store may have other payment methods added by other extensions that should also come into this category.

To do this, you can add the code below as an mu-plugin, or in your child theme’s functions.php, or as a snippet (whatever method you prefer for adding code to your site). You will need to change method_id for the true internal identifier of the new payment gateway. You can discover what this is by reading its code, or asking its supplier.

add_filter('woocommerce_printorders_printnode_print_order_now', function ($print_now, $payment_method, $order) {
return ('method_id' == $payment_method) ? true : $print_now;
}, 10, 3);

If, after doing so, you get the infamous WordPress “white screen of death”, then you accidentally introduced a typing mistake somewhere, and should undo it.

I wish to filter the items printed, or change their order

The code sample below sorts order items by SKU. A competent PHP developer will easily be able to adapt this to fulfil other requirements (e.g. sort in a different way, or omit unwanted items). Please note that our general FAQ on customisations applies.

<?php

add_filter('woocommerce_printorders_printnode_print_order_items', function ($order_items) {
  if (is_array($order_items)) {
    uasort($order_items, 'my_print_order_sorting_function');
  }
return $order_items;
});

// This function sorts based on SKU
function my_print_order_sorting_function($a, $b) {

  // Confirm that both items are order product items
  if (!is_a($a, 'WC_Order_Item_Product')) return is_a($b, 'WC_Order_Item_Product') ? 1 : 0;
  if (!is_a($b, 'WC_Order_Item_Product')) return -1;

  $product_a = $a->get_product();
  $product_b = $b->get_product();

  // Confirm that both products exist
  if (!is_a($product_a, 'WC_Product')) return is_a($product_b, 'WC_Product') ? 1 : 0;
  if (!is_a($product_b, 'WC_Product')) return -1;

  // In this example, we sort via SKU
  return strcmp($product_a->get_sku(), $product_b->get_sku());
}

Are orders created manually in the WooCommerce back-end automatically printed?

No; manual orders are not automatically printed. If you want them to be printed, then you should press the button on the order page in the back-end as part of your process for manually creating them.

How can I automatically print when the order status changes?

The default setup of the plugin should print at the right time for the payment method type (e.g. for “manual” payment methods, like cash-on-delivery or cash-on-collection, it will print as soon as the order is placed; for electronic payments (e.g. PayPal, Stripe), it will print as soon as the order is paid). However, it may be that you have a need to print based on a customised order status change. Here is how to do so.

Create the directory wp-content/mu-plugins in your WP install, if it does not already exist.

In that directory, create a file named wp-content/mu-plugins/order-status-change.php, with these contents:

<?php
add_filter('woocommerce_printorders_printnode_order_status_changed_fire_print',
function ($fire_print, $order_id, $old_status, $new_status) {
 if ('on-hold' == $old_status && 'processing' == $new_status) {
   return true;
 }
 return $fire_print;
}, 10, 4);

You should change the statuses in the above (on-hold, processing), to match your desire setup. Other available statuses in WooCommerce by default are: failed, completed, refunded.

If someone pays using a payment method (e.g. cash-on-delivery) which triggers an immediate print-out when the order is placed, you can suppress that with this fragment:

add_filter('woocommerce_printorders_printnode_print_order_now', '__return_false');

 

How can I print to more than one printer, or print only if further conditions are fulfilled?

You can choose as many printers as you like, using the settings in your WordPress dashboard in WooCommerce -> PrintNode -> Settings:

Configure copies per-printer

If you want to filter orders in a more complicated way, so that orders go to a printer only sometimes (depending on something to do with the order itself) then you will need to do a little custom PHP development for this, in order to implement the logic of your particular requirements. (i.e., you’ll either need to write a little PHP code yourself, or hire a PHP coder – somewhere like codeable.io or freelancer.com is an option if you don’t already have a developer. Please note that customised development isn’t part of your plugin purchase – i.e. we can’t contribute time to do this for you as part of your purchase. However, we’ve done 90% of the work for you, below).

The way to do it is to use the woocommerce_printorders_printnode_copies filter. Using the passed parameters, you can apply arbitrary criteria based upon anything you like concerning the order. Here is a code fragment to start your developer off with:

<?php
add_filter('woocommerce_printorders_printnode_copies', function ($copies, $order, $printer_id, $source, $source_info, $printers) {

	// Get the order details
	$order_meta_data = $order->get_meta_data();
	
	/*
	Do something based on the order, according to what you require...
	
	if ($order_meta_data['key'] ... ) {
		// Suppress this print job (print no copies)
		return 0;
	}
	*/
	
	// If our conditions did not match, then leave things as they were
	return $copies;

}

 

Alternatively, to suppress all automatic printing (so that printing is manual-only):

add_filter('woocommerce_printorders_printnode_print_on_payment_complete', '__return_false');
add_filter('woocommerce_printorders_printnode_print_order_now', '__return_false');

I am using a customised template – how can I add a new font to the PDF?

This FAQ refers to the plugin’s built in “simple” template. If using a PDF generated by another plugin (e.g. WP Overnight’s PDF Invoices and Packing Slips), then you need to follow their documentation instead.

In PDFs, standard Windows core fonts are available. Our plugin also adds Deja Vu, which has good UTF-8 coverage (which the Windows standard fonts don’t). But in case you want to import another font…

If you are printing the output of another plugin, then you will need to consult that plugin’s documentation for guidance on how to embed extra fonts into its output.

If using this plugin’s default template, then you can add extra fonts, like so:

  1. Log in to the shell on your webserver
  2. Navigate to the directory wp-content/plugins/woocommerce-printnode/vendor/dompdf/dompdf/lib/fonts
  3. Copy the font you wish to import, which must be in TrueType format, into this directory. Include bold and italic versions, if you intend to use them.
  4. Navigate to the base directory of the plugin, and run the script load_font.php in the “utils” directory  (run “php utils/load_font.php” to show the syntax). Make sure that the font name matches the font name you will use in your template HTML.

Remember to use the CSS font-family selector where appropriate in your template HTML to actually select your chosen font.

Note that the above changes will be wiped out if/when you upgrade the plugin. To avoid this, after adding the font, you can copy the fonts directory (wp-content/plugins/woocommerce-printnode/vendor/dompdf/dompdf/lib/fonts) to a different directory on your webserver, and define the constant DOMPDF_FONT_DIR in your wp-config.php to point to your new directory.

e.g. if you copied it to the folder /home/myuser/public_html/dompdf-fonts, then you’d put:

define(‘DOMPDF_FONT_DIR’, ‘/home/myuser/public_html/dompdf-fonts’);

How can I customise this plugin, beyond the obvious settings?

This plugin uses WordPress’s standard customisation mechanisms – hooks and filters. As with every other such plugin, a competent developer can read the plugin code, and hook into it at any of those points (see here, or here for a tutorial). (Please note that customised development is not included in the purchase price of any plugins).

To customise the “internal” format’s template, you have various options. The output is created by the file templates/cloud-print.php found in the plugin’s directory (wp-content/plugins/woocommerce-printorders). You can copy this file as templates/cloud-print.php in your theme or child theme directory, and then modify it. Instructions are at the top of that file. If you simply wish to add or change CSS styles, then this can also be done with a hook (the woocommerce_printorders_css filter). Alternatively, you can use the woocommerce_printorders_printtemplate filter to use a template of your own devising at a different location. There are various other hooks that may be better than copying the template, for simple tasks.

To customise the output of your invoices/packing notes/etc., for all formats except the “internal” (short) format, you should follow the link (from the WooCommerce -> PrintNode page, in the ‘Settings’ tab) to the settings for the plugin that creates the document, and use the options provided there. You can also create your own templates for those options (guided by the documentation for the relevant plugin).

Thirdly, you may find the debugging log feature useful – this is configured in WooCommerce -> Settings. WooCommerce’s standard logging mechanism is also used, so you can also find logs in your WooCommerce log directory (usually wp-content/uploads/wc-logs).

I haven’t managed to connect my printer to PrintNode. Please can you help?

Unfortunately, the price we have pitched the plugin at does not allow us to help with any general printing issues. The plugin is a connector between PrintNode and your WordPress site, and we are only specifically able to support that aspect. (To use an analogy, if you buy new tyres for your car, then you’ll understand that the tyre supplier’s after-sales support will not include investigating engine issues). To use this plugin, you need to ensure that your printer, any device driving the printer, network and connection to PrintNode are all working, as pre-requisites. You can and should ask PrintNode for support with any issues with your PrintNode account and the associated service.

I wish to print when an order begins processing, not when it is paid

By default, orders made with “manual” payment methods (like cash, cheque or bank transfer) are printed as soon as they are placed. Orders made with automatic methods (which means that the payment gateway can inform WooCommerce that a payment has been made) are not printed when placed, but when the payment signal is made (in WordPress/WooCommerce developer terms, this means “when the ‘woocommerce_payment_complete’ action is called).

If the signal never comes, then it’s best to investigate why not. However, you can, if you prefer, instead make your orders print when they are placed instead, by adding this snipped as an mu-plugin (i.e. add this as a file ending in .php in wp-content/mu-plugins, e.g. wp-content/mu-plugins/print-orders.php):

<?php add_filter('woocommerce_printorders_printnode_print_order_now', '__return_true');

An order has been placed, but not printed – what should I do?

Firstly, if relevant, has payment been made for the order? This plugin will instantly print orders made via manual payment methods, even before payment (e.g. cheque, cash, BACS); for other payment methods where payment notification is automated (e.g. PayPal, Stripe, Authorize.Net, etc.), the order is printed when payment is made. If using PayPal, then please check your PayPal account to see that the payment has actually completed – more than one customer has tested using a freshly-created PayPal account that isn’t capable of processing payments yet, because PayPal haven’t lifted the initial restrictions on the account. Note that “when payment is made” does not mean the same as “when the order status changes” (technically, it is when WooCommerce fires the internal action woocommerce_payment_complete). Often when people are testing they do not realise this and expect something to print if they manually manipulate order status. (If you do want to always print when order status changes, go here for help).

Have you selected any templates to actually be printed? Check the plugin settings in WooCommerce -> PrintNode -> Settings

Is your printer yet connected to PrintNode? This plugin sends a print job to PrintNode… until your printer is actually connected to PrintNode, it won’t print anything. Use the “Print” button in your PrintNode account – https://app.printnode.com/app/print – to send test print jobs to your printer via PrintNode. (Please note that for support for issues with PrintNode itself or your account with them, you should go to PrintNode).

If your printer is connected to PrintNode, then is your website correctly set up to connect to it? Go to the WooCommerce -> PrintNode -> Printers  page in your WordPress dashboard and print out a test. If that does not work, then your website is not yet connected to PrintNode.

Is your printer switched on? If it needs to be connected to a computer, then is it – and is the computer switched on? You can check at this link to see if PrintNode has received your job: https://app.printnode.com/app/print. If the job is in your PrintNode queue, then this plugin has finished its work – the problem lies further down the line, and you need to look at where.

You should also make use of the option to send an email with debugging information (in WooCommerce -> PrintNode -> Settings), as in this screenshot (send this log to us if requesting support, together with information from all the above items, e.g. payment method, etc.):

Email debugging