WooCommerce PDF Invoice, Packing Slip, Delivery Notes, and Shipping Label plugin allows you to print and download various document types. By default, the plugin prints the address in US standard format which is in the order City, State, Zip in all the documents types.
There can be instances where you prefer to print the addresses in EU standards which is in the order Zip, City, State. To modify this default behavior of the plugin, insert the below-given code snippet in the active theme’s functions.php file.
Likewise, if you wish to display only the Zip, City in the address, then insert the following code snippet in the active theme’s functions.php file.
Ian Donaldson
January 22, 2022
Loving the invoice functionality, however the address in shipping labels is slightly strange for UK format (even with using the code)
Adress should be
Business Name
1st Line Address
2nd Line Address
City
Postcode
Country
However even with the code above I get the city and postcode on the same line, also noticed on some orders it shows the customer telephone number however we do not want to have the customer telephone numbers on the address label. Your help is much appreciated.
Kind Regards
Ian
Joakim
October 19, 2021
Hi,
This code to EU format have stopped working for me now. It use to fork fine.
Running WordPress 5.8.1
Code Snippets 2.14.2
Woocommerce 5.8.0
Does anyone have a solution?
Mike
October 25, 2021
Hi Joakim,
Thanks for reaching out to us. Kindly share your WooCommerce system status report (WooCommerce>status>system status report) via this link.
Richard Siberry
August 10, 2021
I want to format my shipping label so that the “from” address is in one line across the top of the label, and the “to” address and tel. number is in a stacked format centred on the label, beneath the “from” address. I don’t want any further information on the labels. I want the labels to print in a 4×3 format from my Zebra thermal transfer printer. I am getting nowhere following what I can of your instructions. I’m not a developer, and I can’t get your existing templates to work for this size label.
Seb
February 26, 2021
Hello,
In the code, where exactly do I have to insert the given snippet?
Mark
March 4, 2021
You can add it to the end of the file.
MAYOUX Jérôme
March 9, 2021
Seb, you can also add a plugin like Code Snippets to do it. Works like a charm 🙂
Mohammed Hassan
February 6, 2021
What if I want to change the order?
for example I want billing address 1 and 2 before the company? and write some texts before each field for example “Company Name: $company” is there something similar to this?
Mark
February 19, 2021
Hi Mohammed,
Here is a sample code to do:
https://gist.github.com/webtoffee-git/16e58d75ca3eba43f98f0dfadd242c5e