The EU VAT Assistant already adds the VAT number to the customer’s billing address. It’s stored in the User Profile page, under the Billing Address section (example: https://prnt.sc/26nyw9f).
The VAT number is added automatically to the billing address when one calls method WC_Order::get_formatted_billing_address()
. If the PDF invoicing plugin calls that function, then the VAT number should appear too. If you run a test with the plugin PDF Invoices and Packling Slips, you should see that working out of the box.
If the VAT number doesn’t appear in the billing address, I would speculate that one of the following is happening:
1. The PDF invoicing plugin is not calling function WC_Order::get_formatted_billing_address()
, but fetching each part of the address independently. In that case, you can fetch the VAT number from the order’s meta, which is called vat_number
(i.e. $order->get_meta('vat_number')
), and append it to the address. The authors of the PDF invoicing plugin would be the best point of contact to learn how to do that.
2. Some other element (e.g. some other plugin) is removing, or replacing the VAT number loaded by the EU VAT Assistant as part of the billing address. In this case, you could try to go by exclusion, disabling one plugin at a time (keeping the EU VAT Assistant, of course), to see when the VAT number appears on the invoice.