The WooCommerce Orders Table, which can be found under WP Dashboard > WooCommerce > Orders, provides us with 7 default columns: Order – Date – Status – Billing – Ship to – Total – Actions. This is used by shop managers to have an overview of all orders, before eventually clicking on a specific one.
So the question is: how can we display additional columns to that same orders table, so that we can immediately visualize an order custom field, a specific product contained in the order, or anything order-related that can be “calculated” once we have access to the $order variable?
PHP Snippet: Display Custom Column @ WooCommerce Admin Orders Table
/** * @snippet Add Column to Orders Table (e.g. Billing Country) - WooCommerce * @how-to Get CustomizeWoo.com FREE * @sourcecode https://businessbloomer.com/?p=78723 * @author Rodolfo Melogli * @compatible WooCommerce 3.4.5 */ add_filter( 'manage_edit-shop_order_columns', 'bbloomer_add_new_order_admin_list_column' ); function bbloomer_add_new_order_admin_list_column( $columns ) { $columns['billing_country'] = 'Country'; return $columns; } add_action( 'manage_shop_order_posts_custom_column', 'bbloomer_add_new_order_admin_list_column_content' ); function bbloomer_add_new_order_admin_list_column_content( $column ) { global $post; if ( 'billing_country' === $column ) { $order = wc_get_order( $post->ID ); echo $order->get_billing_country(); } }
Hi , no longer works with New HPOS Meta data structure.
I find this unlikely, wc_get_order works with HPOS as well
It doesn’t work here either with HPOS enabled. Do you know any alternative codes for this?
Not yet, as I haven’t switched to HPOS yet!
Hi, I love your work.
Can you show hot to add Phone Number Column at the main WooCommerce Customer Page?
Thanks.
Hello Tiago, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
still working on wp 6.11 with up to date woocommerce. Thank you
Nice
Hi,
I want to show the product regular price in order admin dashboard and i have tried using get_regular_price() function but it’s showing error?
Hi Rohini, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
The code is wonderful congratulations. What if I want to show the product name?
Hello Andre, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi, Thanks for the amazing article. I need to add more than one column here, how can I dot that?
Hi Asad, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi, this code is very helpful. Could you just tell me how to change the billing country to the product name so that we have in 1 screen the order number and the product name? this would help us in linking the payment to the correct product. thank you !
Hello Cedric, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi Rodolfo! great!
I need to add a column called “User profile” to show the client profile, is this possible?
thanks!
Hi Gonzalo, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
I have tested the code on my site but it doesn’t work
Works for me Nando, sorry. Try with no plugins but Woo and 2020 theme
Sorry, the code works perfectly, I had an active plugin that blocked this function.
But I have a question, how can I show a user meta field in that column? I’ve created the following custom field in the user backend as follows, and I need to display it in that column:
Good to know!
Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
HI I want add Products Category in order table. Can you please another blog about this?
I’ll add it to the long list 🙂
Hi Rodolfo,
Thanks for the article it was very helpful for me. Is it possible to edit this column on the Woocommerce dashboard? Or do I need to make a separate form and function to update the new column?
Not sure I fully understand. What do you mean by “edit”?
It is possible to alter the default displayed order column? ( the first column)
Instead display only order no. & customer name, I would like to add some extra string placed after each customer name!
Please give me instruction.
Thank you
Hey Narong, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hello
thanks for all of your tips
can add item name or SKU in column ?
Hi Majid, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi Rodolfo,
Thanks for the tutorial. I have almost the same question as Carole asked in 2018. Is that possible to show all the photos for ordered items include variations (if exist) and how to make it happen? I tried different ways and just can’t make it work.
Thanks a lot!
Hello Leon, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi
is it possible to change the column title?
Hey Somy, yes, it is inside the function bbloomer_add_new_order_admin_list_column()
Hi,
I have some custom checkout fields I would like to show as columns, how do I need to change your code to work for my use case?
I tired it as it is but only seems to work for standard checkout fields like country, state, first name, etc.
Btw, thank you for the snippet 🙂
Hello there, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R
Hi Rodolfo,
Perfect, I added my code for get_total_tax(). It’s helpful for to do my accounting (with Dougs), not oblige to open each order for check if I must indicate if it’s taxed or not. But right now I’ve no idea how to add the Stripe fee in a column. I’m going to see that later. Unless you have an idea 🙂
Thanks a lot again for your tips.
Rémi from France.
Excellent! I’m sure you’ll figure out the Stripe thing as well 🙂
Hi Rodolfo,
This is again a great article, One of my friends is using this method. It really helps them.
Cool 🙂
Hi Rodolfo,
Thanks for yet another great Woo snippet! Can this be used to display which coupon code was used for each order, if any?
Thanks!
-Steve
Hey Steve – thanks so much for your comment! Positive, the get_used_coupons() function should help 🙂
Could I add a column for the product photo?
Hello Carole – thanks so much for your comment! Of course – as long as orders have max 1 product or if you just want to show the first product 🙂
Greetings Rodolfo !
Thanks for your tips !
I’m going to try it this week. That will be helpful for me, I wish to see Tax, Stripe fee,.. for to do my accounting without open each order. I will se if I can with your tips.
(However, maybe I can do that by export all order in a xls table)
Thanks
Rémi
Rémi – thanks so much for your comment! Good luck 🙂