A simple way to list WooCommerce orders in the front end

List WooCommerce Orders Front End

If you need to list WooCommerce orders on the front end of your website then you can do this with our Posts Table Pro plugin, a WordPress table plugin. It displays orders in a responsive table for front-end WooCommerce inventory management. This is the complete guide on how to display WooCommerce order list in the front end using Posts Table Pro.

What is Posts Table Pro?

Posts Table Pro is a popular WordPress table plugin developed and supported by us at Barn2. It lists any type of WordPress content in a structured HTML table. This includes pages, posts, custom post types, and - you guessed it! - WooCommerce order lists!

The WooCommerce plugin is very flexible and comes with dozens of options. You can choose which columns of order data to include in the table, how the table is sorted, and much more.

Please note that we have another plugin called WooCommerce Product Table. This lists normal WooCommerce products in a table. Surprisingly, this is NOT the right plugin to list WooCommerce orders in the front end. WooCommerce orders aren't products - they're separate custom post types. This means that you need to list them using our Posts Table Pro plugin.

In this tutorial, I'm going to tell you how to list all WooCommerce orders in the front end, and how to show orders for a specific customer only.

Let's get started!

How to list WooCommerce orders in a table on the front end

Step 1. Create the table of orders

List WooCommerce Orders Plugin

Follow these steps to create an instant table listing WooCommerce orders:

  1. First, get the Posts Table Pro plugin.
  2. Upon installing the plugin, you will be prompted with an automatic setup wizard to help you create your first table.
  3. You'll first need to provide a name for it and select the post type that you want to display. In this example, we'll choose "Shop orders" as our custom post type. Next, you can choose the posts or product pages you wish to include in the table. You can select from a range of options, including posts, pages, and custom post types.
  4. Once you've selected your content, you can customize your table's appearance by selecting which columns to display and in what order. To add a new column, simply choose the column type from the dropdown menu and click "Add."
  5. You can also customize the sorting options for your table by selecting the default sorting option and the sort direction you prefer. This gives you complete control over the order number in which the WooCommerce orders are listed.
  6. When you've finished, go to Post Tables → Settings, find the "Links" option, and type "none" into it. This stops the orders in the table from being clickable, which is essential because WooCommerce doesn't provide an individual WooCommerce view order page for each order that you can link to in this way. (We'll discuss this a bit more in a minute.)

Essential columns to Include in your WooCommerce order list with Posts Table Pro:

    • ID - rename this column to "Order ID".
    • Date
    • Shipping first name - Add this as a custom field column, enter _shipping_first_name as the custom field name, and rename the column to "First Name".
    • Shipping last name - Add this as a custom field column, enter _shipping_last_name as the custom field name, and rename the column to "Last Name".
    • Shipping address 1 - Add this as a custom field column, enter _shipping_address_1 as the custom field name, and rename the column to "Address 1".
    • Shipping city - Add this as a custom field column, enter _shipping_city as the custom field name, and rename the column to "City".
    • Postcode - Add this as a custom field column, enter _shipping_postcode as the custom field name, and rename the column to "Postcode".
    • Phone - Add this as a custom field column, enter _shipping_postcode as the custom field name, and rename the column to "Phone".
    • Total - Add this as a custom field column, enter cf:_order_total as the custom field name, and rename the column to something like "Total ($)".

Step 2. Ensure Posts Table Pro can display your WooCommerce orders

Next, you need to make sure the WooCommerce orders are stored in a way that Posts Table Pro can access. This step is only needed on new websites which were first created with WooCommerce 8.2 or later because of the way that data about orders is now stored. If you have an older site then you can ignore this step because your WooCommerce orders will be stored in both the old and new locations.

If you have a newer site, then you should go to WooCommerce → Settings → Advanced → Features and tick the 'Enable compatibility mode' box.

Please note that this may have an impact on performance because it is forcing WooCommerce to use an older method for data storage. As a result, you should test it carefully. However, this is currently the only way to display WooCommerce orders using Posts Table Pro. We hope to update the plugin to remove this step in the future.

WooCommerce compatibility mode HBOS

What else can I list in the table of WooCommerce orders?

I've included some sample columns in the instructions above, but you don't have to use these. There are lots of possible columns that you can include in the list of WooCommerce orders. Feel free to add whichever you need on the Columns page of the table builder.

Order status

To include this in the WooCommerce order list, add a "status" column.

Order meta fields

In addition, you can add columns in the table for any of the custom fields associated with WooCommerce orders. These are stored in the wp_postmeta database table and here's a list of them all. For each of these, create a custom field column and enter the custom field name shown below:

  • Customer IP address - _customer_ip_address
  • Customer's browser and operating system - _customer_user_agent
  • How the order was created (this will normally say 'checkout' - _created_via
  • Billing details:
    • Complete billing information (lists the name, address etc. in a single column of the table) - _billing_address_index
    • Billing first name - _billing_first_name
    • Billing last name - _billing_last_name
    • Billing company name - _billing_company
    • Billing email address - _billing_email
    • Billing phone number - _billing_phone
    • Billing country - _billing_country
    • Billing address line 1 - _billing_address_1
    • Billing address line 2 - _billing_address_2
    • Billing city - _billing_city
    • Billing state - _billing_state
    • Billing postcode - _billing_postcode
  • Shipping details (if different from billing details):
    • Complete shipping information (lists the name, address etc. in a single column of the table) - _shipping_address_index
    • Shipping first name - _shipping_first_name
    • Shipping last name - _shipping_last_name
    • Shipping company name - _shipping_company
    • Shipping country - _shipping_country
    • Shipping address line 1 - _shipping_address_1
    • Shipping address line 2 - _shipping_address_1
    • Shipping city - _shipping_city
    • Shipping state - _shipping_state
    • Shipping postcode - _shipping_postcode
  • Order payment data:
    • Currency - _order_currency
    • Do prices include tax? - _prices_include_tax
    • Payment method code - _payment_method
    • Payment method name - _payment_method_title
    • Total order cost - _order_total
    • Shipping cost - _order_shipping
    • Total discount - _cart_discount
    • Payment date - _date_paid
    • Payment date (user-friendly format) - c_paid_date
  • Tax information:
    • Total tax - _order_tax
    • Shipping tax - _order_shipping_tax
    • Tax discount - _cart_discount_tax
  • Transaction ID (e.g. if you're using PayPal) - _transaction_id
  • Order status data:
    • Date the order was marked as complete - _date_completed
    • Date the order was marked as complete (user-friendly format) - _completed_date

Note: This will also be useful if you're looking for a list of database fields for WooCommerce get all orders list. I couldn't find a list of these fields anywhere else online, so I went through the WordPress database and figured it out myself.

List WooCommerce orders based on their status

In the previous section, I showed you how to list all orders regardless of status. If you prefer, you can set the table to display orders with a specific status only.

To do this, you need to set the status option in the Posts Table Pro for WooCommerce order history shortcode which you use to insert the WooCommerce order table onto your site's backend.

The available options are:

  • Completed orders - wc-completed
  • Orders pending payment - wc-pending
  • Payment processing - wc-processing
  • On hold orders - wc-on-hold
  • Cancelled orders - wc-cancelled
  • Refunded orders - wc-refunded
  • Failed payment - wc-failed

For example:

[posts_table_template="1" status="wc-completed" links="none"]

Other options to customize your list of WooCommerce orders

As I mentioned earlier, Posts Table Pro comes with dozens of options for customizing the display of your orders for WooCommerce inventory management. As well as choosing your columns, you can control the default sort order, show or hide elements such as the search box, product category page, and much more.

You may have noticed that I customized some of the column names in the example WooCommerce order history shortcode above. Here's a direct link to how you can do this yourself, for any of the WooCommerce order table columns.

You can read about all the options in the plugin knowledge base.

In the instructions above, I asked you to disable the links to the individual orders. That's because, by default, Posts Table Pro will add a broken link to the Order ID column. The reason the link is broken is that it's pointing to a front-end WooCommerce view order page, which doesn't exist. As a result, I have shown you how to disable all links in the WooCommerce order table.

If you really wanted to link the ID column to the 'Edit Order' page in the WordPress admin, then you could write some custom code to achieve this. If you don't know how to do this, then I recommend posting a job on Codeable to find a suitable WordPress expert.

Can I list the products for each order?

Unfortunately not, because WooCommerce doesn't store this in the WordPress database in a way that Posts Table Pro can display. You will need to view the individual order in the WordPress admin to access the list of new products.

Here's a quick tip on the fastest way to do this:

  1. Copy the Order ID from the list of WooCommerce orders.
  2. Go to [your-domain]/wp-admin/post.php?post=12345&action=edit - replacing 12345 with the Order ID that you wish to look up.

This will take you straight to the Edit Order screen, which includes a list of products ordered.

Don't forget customer confidentiality!

List WooCommerce orders securelyThe reason WooCommerce doesn't come with a built-in option to display orders in the front end is that this information is normally confidential.

However, there are some situations where it's appropriate to list WooCommerce orders on the front end.

For example, you might want to create a hidden WooCommerce view order page for delivery drivers to see, without giving them access to the WordPress admin. You might want to do the same for your administrative or finance staff. This is where the plugin comes in useful for front-end WooCommerce inventory management.

Whatever your reason for displaying WooCommerce get all orders lists in the front end, make sure you add the appropriate security measures to protect customer data.

As a minimum, this should include using an SSL certificate and hiding the list of orders on a password-protected page or other hidden areas. Your list of WooCommerce order data should only be available to people who really need access to it.

Can customers see a front-end list of their own orders?

Yes, and you don't need any extra plugins to do this. The Woo 'My Account' page already includes a list of orders, so customers just need to log in and view their past custom orders. There's also a shortcode for this, which you can add products anywhere customers are logged into their account: [my_orders]

But if you want to list all customize WooCommerce orders in the front end, then you'll need Posts Table Pro for this.

Can customers see a list of their own orders?

So far, I've shown how WooCommerce get all orders list in the WordPress front end for WooCommerce inventory management. But what if you want to show orders for the current user only? For example, if you're running a multi-vendor site then you might want each vendor to view a table or report of their own orders.

Unfortunately, this is a bit tricky because WooCommerce doesn't store the customer details as a taxonomy on the 'shop_order' post type that you can use to control which orders to include in the table. As a result, you need to create a new way to store this information so that Posts Table Pro knows which orders relate to the current customer.

Here are two suggested workarounds. The first is aimed at non-technical users and requires a bit of manual work. The second is for developers and is more automated.

Option 1 - Create a hidden page for each customer listing their orders

  1. Add a hidden page for each customer and password protect it.
  2. Create a custom taxonomy called 'Customer' or similar, and use it to tag each order with the correct customer's username or ID.
  3. Use Posts Table Pro for WooCommerce get all orders list on the page. On the page of the table builder where you choose which posts to include, select "Custom taxonomy" and select the term that you're using for the individual customer. For example, if you have tagged a user's orders with "user1" then you should select this.
  4. Send the customer a link to their page, along with the password.
  5. Repeat steps 1-4 for all the customers who need to see their own orders in the WP front end.

Option 2 - Automated solution

For a more automated solution with less manual work, here's an alternative method for you (or your developer):

  1. Create a custom taxonomy on the 'shop_order' post type, and code it to automatically populate with the username of the person who placed the order.
  2. Modify the template for the WooCommerce Account page to replace the default list of orders with a Posts Table Pro for WooCommerce order history shortcode.
  3. Replace "customer" in the shortcode with the slug of the taxonomy you created in step 1 a minute ago.
  4. Instead of "user1", you need to dynamically populate this part of the shortcode with the customer's username (which you are storing as a taxonomy term, as described in step 1).

Once you have done this, the WooCommerce Account page will include a table listing orders for the current user.

Displaying WooCommerce orders on your website: Developer and non-developer options

If you're a developer looking to use WooCommerce get all orders programmatically, you can use the wc_get_orders() function. This function returns an array of order objects that you can loop through to display the relevant order information on your front end.

However, it's important to note that this method requires some programming knowledge and may not be suitable for non-developers. If you're not comfortable with writing code, it's recommended to use a plugin such as Posts Table Pro to display your WooCommerce get all orders programmatically on the front end of your WordPress website.

With Posts Table Pro, you can easily create a table of your WooCommerce orders with sorting and filtering options without any coding skills. Simply install and activate the plugin, and then use the [posts_table] shortcode to display the orders on any post or checkout page.

To customize the table, you can use the plugin's built-in settings to choose which columns to display, set up filters, and more. This is a great option for non-developers who want to display their WooCommerce get all orders programmatically on the front end of their ecommerce website without having to write and reorder any code.

Over to you!

By now, as a store owner have all the information you need to list WooCommerce orders for front-end WooCommerce inventory management.  Get the WordPress table plugin, Posts Table Pro, and set it up today!

I'd love to hear how you use lists of WooCommerce orders on the front end of your shop page. What information do you include? What do you use it for? How have you made sure your customer data is safe? Please leave your comments below.

52 Comments

  1. You guys used to write brilliant and clear articles. This one is not one of them: E.g. "In this example, we'll choose "Shop orders" as our custom post type. Next, you can choose the posts or product pages you wish to include in the table. You can select from a range of options, including posts, pages, and custom post types." No "Shop orders" custom post type shows up in the dropdown list. What do you mean be select a range of options? I got stuck right there at the beginning. But what about the table displayed toward the end of the article? Has nothing to do with orders(?).

    • Hi, John. I'm sorry to hear you're having difficulty with the WooCommerce "Shop orders" post type not displaying in the dropdown for selecting the type of content you want to display when creating a table in the Table Builder. Thanks for letting us know so we can help sort it out. So that we can assist you with this best and provide you with full support as quickly as possible, please could you submit a request via our Support Center together with your plugin license key. Many thanks.

  2. Hi, i am looking for this plugin to list user whom have purchased the item and list them out in the front end on the specific product page. It's like a purchase history that is visible to all user. Am i able to use the posts_table with product_id together and display the purchase history front end? Thanks

    • Hi, Weng Seng. Thanks for asking. I'm afraid listing users and the products they've purchased isn't a function of any of our plugins. If you are unable to find a plugin that allows you to do this specifically, you or your developer might need to implement this via a customization, coding, or custom plugin. If you're unfamiliar with this and don't have a developer who can do this for you, then I recommend that you post a job on Codeable where their pre-approved WordPress experts will send you a quote. Thanks!

Please share your thoughts...

Your email address will not be published. Required fields are marked *