It seems strange to me that printing invoices and packing slips isn’t part of the default WooCommerce plugin, but luckily I found the free plugin WooCommerce PDF Invoices & Packing Slips that solves that problem. However, my client wanted the customer email and phone number to be printed on the PDF invoice. I thought it was strange that it wasn’t included automatically, but it wasn’t hard to add it in. Here’s what I had to do:
1) The plugin says that if you want to create any customizations to the template, you need to copy the files from wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/pdf/simple to your (child) theme in wp-content/themes/yourtheme/woocommerce/pdf/yourtemplate to customize them. Of course, I have used “yourtheme” here because I don’t know what your theme is, but the plugin actually helps you out here if you go to
WooCommerce > PDF Invoices > Template
You can see here that my theme is Swank and it tells me exactly where to put my files.
Under this, it also lets you add your logo to the top of the invoice, which will transfer over to your custom template. That is a really nice feature.
So, in that folder I found these five files and moved them over as instructed. In order to add the email & phone number to the invoice, the only file I had to change was invoice.php.
In that file, I found this line:
billing_address(); ?>
And changed it to this:
billing_address(); ?>
billing_phone(); ?>
billing_email(); ?>
The last thing that I almost forgot to do was to change the template used in the settings. So go back to
WooCommerce > PDF Invoices > Template
By default, it’s set to “Simple”. I had changed my folder name within my own theme to “custom-pdf-template”, so I used the dropdown to select that.
One last note, if the customer doesn’t fill out their phone number with the dashes, then no dashes will show.
Overall, this is a really nice add-on for WooCommerce and probably a must if you will be shipping items.
Leave a Reply