WooCommerce Order Barcodes generates unique barcodes for every order placed on your site. These barcodes can be used on e-tickets, e-reservations, packing slips or anything else that would benefit from having a scannable barcode attached to it.
Overview ↑ Back to top
Barcodes are generated for every order as soon as they are placed.
They are also generated for orders that are created manually via the WordPress dashboard. Once an order has been placed, the barcode is included in all order emails as well as the order details page in the customer’s WooCommerce account area. This allows the customer to easily print out the barcode if necessary.
Installation ↑ Back to top
- Download the .zip file from your WooCommerce account.
- Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
- Install Now and Activate the extension.
More information at: Install and Activate Plugins/Extensions.
Setup and Configuration ↑ Back to top
Go to: WooCommerce > Settings and scroll down to the ‘Order Barcodes’ section:
Customize the type of barcodes that your site will generate, as well as colors of the barcode.
Changing these settings will only affect future barcodes. Barcodes that were already been created will be be unaffected.
There are five barcode types available. Here are examples of each:
Code 39, 93 and 128 barcodes will work with standard USB barcode scanners, while the Data Matrix and QR Code types will work with digital scanners and mobile devices. The barcode type that you should use will depend on the best solution for your use case.
Usage ↑ Back to top
Generating barcodes ↑ Back to top
Barcodes are generated automatically when the extension is active, so you don’t need to do any extra setup to get that side of things working correctly. You can view existing barcodes on the order edit screen in the WordPress dashboard:
Scanning barcodes ↑ Back to top
In order to scan your barcodes you can use the
[scan_barcode] shortcode. This will generate a form that looks like this:
This form will only be usable by users with the
manage_woocommerce capability. It allows you to scan or enter a barcode and perform one of four actions on the order to which it is linked:
- Look up – This will simply look up the order details and display them on screen.
- Complete order – This will mark the order as complete and then display the order details on screen.
- Check in – This will marked the order as ‘checked in’ and then display the order details on screen.
- Check out – This will marked the order as ‘checked out’ and then display the order details on screen.
You can pre-select one of these options using the
action parameter of the shortcode by setting it to one of the following:
checkout. The shortcode with a pre-set action will look like this:
[scan_barcode action="checkin"]. All actions are performed via ajax so the page does not reload after running them – this means you can scan in barcodes rapidly without long wait times between each scan. The order details are displayed using the
view-order.php template, so if you have customised that template on your site then they will follow those same customizations.
Using a smartphone or tablet
The most common way to scan barcodes for events is using a smartphone or tablet. This can be easily achieved by using the scanning form along with a free app on your phone or tablet. All you need to do is load up the page with the scanning form in the browser of your smartphone or tablet and then open up one of the many apps available for this purpose and you can scan your barcodes quickly and easily. We do not make any of these apps, but here are two that are very effective:
- Barcode Scan to Web for iOS
- Tips for use:
- Access the app settings and enter the URL for your check-in page as the homepage URL
- Use the “back arrow” at the top to return to the home screen, and then click the home icon at the bottom to refresh. You should then see the check-in page, but not the form itself. You will need to log-in to see the check-in form.
- Go to the address bar at the top and edit the URL to go to /wp-admin
- This will take you to the standard WordPress login screen, where you’ll need to log in.
- Once logged in, hit the home button again at he bottom to re-load the check-in page and you’ll be ready to scan barcodes!
- Tips for use:
- Barcodescanner Keyboard for Android
We obviously cannot guarantee these apps, but they are the ones that we have found effective in our testing. You can do a simple search of the iTunes Store as well as the Google Play Store to find other similar apps as well. Specific usage instructions will be available in the apps themselves.
Using a USB scanner
If you are using a USB scanner to scan in your barcodes, then the scanner will be automatically detected and the action will be performed without you having to click the ‘Go’ button. This will save a lot of time when, for example, scanning e-tickets at the door to a concert.
Manually typing in a barcode
When manually typing in a barcode you must type in the full string of text that appears below the barcode and then hit enter or click the ‘Go’ button.
Generating barcodes for existing orders ↑ Back to top
Existing orders will not automatically have barcodes added to them. In order to generate barcodes for these orders you simply need to visit the order page in the WordPress dashboard and a unique barcode will be generated and added to the order as you load the page.
Troubleshooting ↑ Back to top
Scanning barcodes results in a ‘permission denied’ error ↑ Back to top
If you are getting a ‘permission denied’ error when you attempt to scan a barcode, as of v1.1 you will see one of the following two error messages:
Security check failed
In this case the security token (also known as a ‘nonce’) is not being checked correctly. This will most likely be due to how your server is setup, so if you get this error then adding the following snippet to your theme’s functions.php file will disable the nonce check:
You do not have sufficient permissions to scan barcodes
In this case the user you are logged in as does not have permission to scan barcodes. The default permissions required are that the user has the ‘manage_woocommerce’ capability, but you can change this to anything you want (or even make it different per user). If you get this error when you don’t think you should then adding the following snippet to your theme’s functions.php file will enable scanning permissions for all users (but you can edit it to process any requirements you like):
FAQ ↑ Back to top
Manual Output / Display of Barcode ↑ Back to top
Use the following PHP to output an order’s barcode anywhere:
Where $order_id is the order ID that you want the barcode for.