WooCommerce Admin Orders List

WooCommerce Admin Orders List

Customize WooCommerce admin orders list: add custom columns; add multiple status filtering

Description

WooCommerce Admin Orders List module allows you to customize WooCommerce admin order list (i.e. list at “your site admin dashboard > WooCommerce > Orders”). You can:

  • add custom columns,
  • customize statuses menu,
  • change columns order.

Admin Orders List – Custom Columns

This section lets you add custom columns to WooCommerce orders list.

WooCommerce Admin Orders List - Admin Settings - Custom Columns

Enable section
Enables "Custom Columns" section.
Default: no
Billing Country
Adds billing country column and filtering.
Default: no
Currency Code
Adds currency code column and filtering.
Default: no
Custom Columns Total Number
Set the number of additional custom columns here.
Default: 1
Custom Column #X – Enabled
Enable/disable custom column.
Default: no
Custom Column #X – Label
Custom column’s title.
Default: None
Custom Column #X – Value
Custom column’s value. You can use shortcodes and/or HTML here.
Default: None
Custom Column #X – Sortable
Set if you want column to be sortable. Possible values: No; By meta (as text); By meta (as numbers).
Default: No
Custom Column #X – Key (if sortable)
If column is set to be sortable, set sorting key here.
Default: None
Custom Columns Usage Example #1

With Booster you can add custom columns to admin order list. Best way to add columns is to use Booster’s orders shortcodes. For example you can add order’s items total weight to admin order list with [wcj_order_items_total_weight] shortcode.

woocommerce-orders-admin-orders-list-custom-columns-admin-settings

Admin Orders List:

woocommerce-orders-admin-orders-list-custom-columns-admin-orders-list

Custom Columns Usage Example #2

If you want to add order’s items info to the list (like it was in WooCommerce before version 3.0.0), you can add something like this to custom column’s value:

<details>
<summary><em>Show items ([wcj_order_items_total_number] / [wcj_order_items_total_quantity])</em></summary>
[wcj_order_items field="_qty_x_name" sep="<br>"]
</details>
Custom Columns Usage Example #3

Let’s say, you want to display order’s payment method in custom column, and also make it sortable. To output payment method you can use Booster’s [wcj_order_payment_method] shortcode in “Value” field. To make it sortable, you need to set _payment_method_title in “Key (if sortable)” field.

Custom Columns Usage Example #4

Let’s say, you want to display Booster’s products input fields in orders list, and also make it sortable. If you want to to display each product input field in its own column, you can use [wcj_order_items_meta meta_key="_wcj_product_input_fields_global_1"], [wcj_order_items_meta meta_key="_wcj_product_input_fields_local_1"] etc. shortcodes in “Value” field. Making it sortable is more complicated, as sorting is done by order’s meta fields, but product input fields are stored as order’s item meta and not as order’s meta fields. So you need to create new order item meta fields for that. You can use woocommerce_checkout_order_processed filter, so each time order is created, product input fields are automatically copied to order’s meta. Try adding this to your (child) theme’s functions.php file:

add_action( 'woocommerce_checkout_order_processed', 'copy_product_input_fields_to_order_meta', PHP_INT_MAX );
function copy_product_input_fields_to_order_meta( $order_id ) {
$fields_to_update = array(
'_wcj_product_input_fields_global_1',
'_wcj_product_input_fields_local_1',
);
foreach ( $fields_to_update as $field_to_update ) {
update_post_meta(
$order_id,
$field_to_update,
do_shortcode( '[wcj_order_items_meta order_id="' . $order_id . '" meta_key="' . $field_to_update . '"]' )
);
}
}

Now you can use _wcj_product_input_fields_global_1 or _wcj_product_input_fields_local_1 in “Key (if sortable)” options.

Admin Orders List – Multiple Status

In this section you add extend standard order by status selection in admin order list.

WooCommerce Admin Orders List - Admin Settings - Multiple Status

Enable section
Enables multiple status section.
Default: no
Multiple Status Filtering
Possible values: Do not add; Add as multiple select; Add as checkboxes.
Default: Do not add
Hide Default Statuses Menu
Default: no
Add "Not Completed" Status Link to Default Statuses Menu
Default: no

You can add checkboxes or multiple select list, so admin can select multiple order status. If you need to style the checkboxes with CSS, use #wcj_admin_filter_shop_order_statuses.

woocommerce-orders-admin-orders-list-multiple-status-admin-orders-list

There is also option to add all not completed orders link.

woocommerce-orders-admin-orders-list-multiple-status-admin-orders-list-all-not-completed-orders-link

Admin Orders List – Columns Order

If you wish to change the columns order in admin order list, you can do so with this section. Just enter columns in required order, one column ID per line.

WooCommerce Admin Orders List - Admin Settings - Columns Order

Enable section
Enables columns order section.
Default: no
Columns Order
Default:
cb
order_status
order_title
order_items
billing_address
shipping_address
customer_message
order_notes
order_date
order_total
order_actions
Accessible through:
  • WooCommerce > Settings > Booster > Shipping & Orders > Admin Orders List
Tested on WooCommerce 3.4.3 and WordPress 4.9.7
Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

Leave a Reply

Comments

4 Comments

  1. zimart_snk January 5, 2018 at 3:46 pm #

    how it’s works ?
    I need add custom fields in column… ..

    Reply to thread

    • zimart_snk January 5, 2018 at 3:52 pm #

      ok…
      key : [wcj_order_custom_field name="xxx"]

      🙂

  2. Peter January 7, 2018 at 5:29 pm #

    Hi!

    I’m trying to get a sortable column with the customers nickname.
    I’ve added a column with a shortcode for the nickname which works fine, but sorting only shows an empty order list.
    Is there a quick way to do this the correct way?

    Reply to thread

    • Booster Support Team January 10, 2018 at 5:57 pm #

      Hi Peter,

      Unfortunately you can sort only by order meta, and customer’s nickname is not saved as order meta. One suggestion would be to sort by customer’s ID – in this case you need to enter _customer_user in “Key (if sortable)”. Another option – sort by billing name – in this case you need to enter _billing_first_name there.

      Please let me know if that’s good enough. If not – I will try to come up with another solution.

      Best regards,
      Tom

      Booster Support Team