Advanced Order Export for WooCommerce

Status Change Jobs Code Samples

Need PDF exports that look like real invoices? With addresses above the product list?

Here’s how.

What this code does

Your standard PDF export shows products first. Then order details at the bottom.

This flips that. Billing address, shipping address, phone, and email appear at the top. Just like an invoice.

The complete code

What appears at the top

  • Billing address (formatted nicely)
  • Shipping address (right column)
  • Phone number (if exists)
  • Email address (if exists)

All above your product rows. Clean and professional.

When to use this

You send PDF invoices to customers. Need addresses visible immediately.

Your warehouse uses PDF packing slips. Need shipping info before products.

You automate order processing. External system expects invoice-style format.

Setup steps

  1. Copy the entire code block
  2. Paste into your theme’s functions.php
  3. Create or edit a PDF export profile in Advanced Order Export for WooCommerce
  4. Run a test export on a single order

What you’ll see

First page shows addresses at top. Products below. Phone and email right under billing address.

Second page (if needed) continues products. Addresses don’t repeat.

Customize the layout

Change column width: Edit $xOffset = 120. Lower number moves shipping address left. Higher moves it right.

Remove phone or email: Delete the if($order->get_billing_phone()) block entirely.

Add order number: Insert this after the email block:

php

Change address format: Replace PHP_EOL with "<br/>" for HTML-style line breaks. Or ", " for single line.

Common mistake

PDF formatting is fragile. One wrong character breaks the layout.

Test on one order. Check spacing. Verify addresses don’t overlap.

Also, this only runs for the first order. Subsequent orders in the same PDF won’t show addresses again. That’s by design.

Pro tip

Want addresses on every page? Move the code to woe_pdf_header action instead. It repeats on each page.

Need different formatting for packing slips vs invoices? Duplicate the code. Change the condition. Run based on order status.

Real talk

This code uses PHP reflection. That’s advanced. Copy exactly. Don’t change variable names unless you know what you’re doing.

Works with Advanced Order Export for WooCommerce PDF format. Tested on versions 3.x and above.

Your PDFs will look like real invoices. No more confusing layouts.

Have questions? Please submit a support request. We're always happy to help!

Advanced Order Export
for WooCommerce
PRO

From $30
Buy
✓ 30-day money-back guarantee