Advanced Order Export for WooCommerce

Add Calculated Field (For Order)

Need a column that doesn’t exist? Combine state and postcode. Format phone numbers. Create custom text.

Here’s how to build your own calculated fields in Advanced Order Export for WooCommerce.

Step 1: Create an empty custom field

First, add a placeholder field to your export.

  1. Click Confirm
  2. Open Setup Fields in Advanced Order Export for WooCommerce
  3. Click the Common tab
  4. Click Add Field button
  5. Type your meta key in the text box (below the dropdowns)
  6. Fill in Column name (what your CSV header will show)

In the screenshot, “custom_address” is the meta key. “Custom Address” is the column name.

Now move your new field from the right column to the left. That’s your exported fields list.

Click Preview. The column shows empty values. That’s normal.

Step 2: Add the calculation code

Now tell the plugin how to fill that column.

Paste this template into the textarea:

  1. Close Setup Fields
  2. Open Misc Settings
  3. Check Custom PHP code to modify output
  4. Paste this template into the textarea.
  5. Replace FIELD with your meta key (from Step 1)
  6. Replace $value = "text" with your actual calculation

Parameters for the hook:

$value is string

$order is WC_Order object

$fieldname is string

Real example from the screenshots

Meta key: custom_address

Goal: Combine shipping state and postcode with a dash.

Final code:

What the export shows

One column. Combined data. No manual Excel formulas needed.

Debugging

Preview shows empty column? Something’s wrong.

Check Enable debug output in Misc Settings. Run the export again. PHP errors will appear.

Common mistakes:

  • Wrong meta key (misspelled)
  • Missing semicolon at line end
  • Using $order->get_shipping_state() but shipping state is empty

Pro tip

Test with one order first. Use the Preview button with small preview size (5 orders).

Once it works, save your profile. Run full export.

Real talk

Calculated fields are powerful. You can build almost anything.

Start simple. Combine two fields. Get that working. Then add conditions or formatting.

The code runs for every order. Keep it efficient. No heavy database queries inside the loop.

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