You can add extra columns to the Fulfillment Dashboard using two WordPress filters. This is useful for displaying order details that are not shown by default — such as payment method, item count, shipping country, or custom order metadata.
Add the code below to your child theme’s functions.php file or a site-specific plugin. Do not add it to the parent theme — it will be overwritten on theme updates.
Filters
| Filter | Arguments | Purpose |
|---|---|---|
ast_fulfillment_dashboard_custom_columns | $columns (array) | Define the column headers. Key = column ID (string, unique); value = display label (string). |
ast_fulfillment_dashboard_column_content | $value, $order (WC_Order), $column_key (string) | Return the cell content for each row. Must include 10, 3 as the priority and argument count. |
Example 1 — Static text column
Adds a “Note” column showing “Priority Order” on every row.
add_filter( 'ast_fulfillment_dashboard_custom_columns', function( $columns ) {
$columns['my_note'] = __( 'Note', 'your-textdomain' );
return $columns;
} );
add_filter( 'ast_fulfillment_dashboard_column_content', function( $value, $order, $column_key ) {
if ( 'my_note' === $column_key ) {
$value = __( 'Priority Order', 'your-textdomain' );
}
return $value;
}, 10, 3 );
Example 2 — Dynamic order data columns
Adds three columns — payment method, item count, and shipping country — each populated from the WC_Order object.
add_filter( 'ast_fulfillment_dashboard_custom_columns', function( $columns ) {
$columns['payment_method'] = __( 'Payment', 'your-textdomain' );
$columns['item_count'] = __( 'Items', 'your-textdomain' );
$columns['shipping_country'] = __( 'Ship To', 'your-textdomain' );
return $columns;
} );
add_filter( 'ast_fulfillment_dashboard_column_content', function( $value, $order, $column_key ) {
switch ( $column_key ) {
case 'payment_method':
$value = $order->get_payment_method_title();
break;
case 'item_count':
$value = $order->get_item_count();
break;
case 'shipping_country':
$value = $order->get_shipping_country();
break;
}
return $value;
}, 10, 3 );
Useful WC_Order methods
| Method | Returns |
|---|---|
$order->get_id() | Order ID |
$order->get_payment_method_title() | Payment method label (e.g. “PayPal”) |
$order->get_item_count() | Total quantity of items |
$order->get_shipping_country() | Two-letter shipping country code |
$order->get_billing_email() | Customer billing email |
$order->get_total() | Order total (float) |
$order->get_meta( 'key' ) | Any custom order meta value |
Notes
- Use a unique key for each column (e.g.
my_note,payment_method) — duplicate keys silently overwrite each other. - Column values are output as-is. If your value contains user-generated content, escape it with
esc_html()before returning. - Columns are appended after the built-in dashboard columns in the order you add them to the
$columnsarray. They cannot currently be reordered or inserted between existing columns. - These filters are available from AST PRO version 3.0 onwards.
Troubleshooting
- Column header appears but cells are empty — the most common cause is missing the
10, 3priority and argument count onadd_filter. Without3,$orderand$column_keyare not passed to the callback and$valueis returned unchanged. - Fatal error on paste — the code block above uses clean ASCII quotes and standard indentation. If you copy from a rich-text source (email, PDF, Word) smart quotes or non-breaking spaces may be introduced. Paste into a plain-text editor first, then copy into
functions.php. - Filter not firing — confirm the code is in an active child theme’s
functions.phpor a must-use plugin. Code added after the Fulfillment Dashboard has already initialised (e.g. on a late hook) will not register the columns in time.