Advanced Order Export for WooCommerce

WooCommerce PDF Invoices & Packing Slips

Need to track credit notes? Refund numbers and dates in your exports?

The PDF Invoices & Packing Slips plugin creates credit notes for refunds. Standard exports ignore them.

Here’s how to pull credit note details into your order export.

What this code exports

Adds three credit note columns:

  • Credit Note Number
  • Credit Note Date (raw format)
  • Formatted Credit Note Date (readable format)

If an order has multiple refunds, the code takes the first one.

The complete code

Setup steps

  1. Copy the entire code block
  2. Paste into your theme’s functions.php
  3. Go to Advanced Order Export for WooCommerce
  4. Create or edit an export profile
  5. Open Setup Fields → Others
  6. You’ll see credit note fields. Check the ones you need
  7. Save and test on an order with a refund

What your export looks like

Order #Order TotalRefund AmountCredit Note NumberCredit Note DateFormatted Credit Note Date
1001$150.00$50.00CN-2026-001232026-05-15May 15, 2026
1002$89.00$89.00CN-2026-001242026-05-16May 16, 2026

When you need this

You issue refunds. Need to track credit note numbers for accounting.

Your finance team needs credit note dates for reconciliation.

You run reports on refunds by period.

You integrate with external accounting software. Need credit note references.

How it works

When you refund an order, PDF Invoices & Packing Slips creates a credit note. Stores it as a post meta on the refund object.

The code finds the first refund on the order. Pulls the credit note number and dates. Puts them in your export.

Multiple refunds?

The code only takes the first refund. Most orders have one refund.

Need all refunds? Modify the loop. Join multiple credit note numbers with commas.

Empty columns?

No refund on this order. Or refund happened outside PDF Invoices plugin.

Credit notes only exist if you generated them through the plugin.

Common mistake

The code uses _wcpdf_credit_note_number_wcpdf_credit_note_date, and _wcpdf_credit_note_date_formatted as meta keys.

If your plugin version uses different keys, the export will be empty. Check your database for the correct meta keys.

Pro tip

Need the credit note URL? Add another field:

Then in the woe_get_credit_note_field function, add a case for credit_note_url.

Real talk

PDF Invoices & Packing Slips is one of the most popular WooCommerce plugins. But its credit note data isn’t automatically exportable.

This code bridges that gap. Your accounting team gets clean credit note references.

No more manual entry of refund numbers. Export once. Reconcile directly.

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