Orders – Page 2

Add a Custom Order Status in WooCommerce

In this tutorial, we’re going to dive into WooCommerce custom order statuses.

In the first part of the tutorial, I will show you how to add a new order status in WooCommerce; in the second part, we’ll add it to WordPress bulk actions as well, so you can change order statuses for multiple orders at the same time.

One more thing: we’re going to work with custom order statuses programmatically only because I am not a big fan of having an excessive number of WordPress plugins on a single site, especially when it is just enough to deal with a couple of lines of code.

It is also worth noting that my Order Sync and Multisite Order Sync plugins work great with any custom order statuses.

How to Create a Custom Order Filter in WooCommerce Admin

In this guide, I am going to show you how you can easily create a custom order filter for the WooCommerce > Orders page, which will work great for both CPT-based and HPOS orders.

In order to keep this tutorial as simple as possible we’re going to create a filter just by a single custom field value. This is how it is going to look:

how to create an order filter by a custom field in WooCommerce admin

WooCommerce HPOS Explained – High-Performance Order Storage

In this tutorial, I would like to guide you through the High-Performance Order Storage (HPOS) feature in WooCommerce – how to turn it on for your store, how it may affect it, and how to update your plugins in order to make them work with the latest WooCommerce versions.

Create or Update WooCommerce Orders via REST API

In this guide, we’re going to dive into different examples of both creating and updating WooCommerce orders using the REST API. By the way, if you’re looking for a way how to delete orders using REST API, check my other tutorial out.

WooCommerce Network Orders Dashboard Widget

Today I am going to talk about a very interesting widget in WooCommerce which is available to you only when you’re using WooCommerce within a WordPress Multisite network:

WooCommerce network orders dashboard widget

This widget appears in two places:

  • Network admin dashboard,
  • Admin dashboard of a main site of your multisite network (usually a site with ID = 1).

In order for this widget to appear, WooCommerce has to be either network activated or activated for the main site of your network.

Let’s take a look how this widget really works.

Custom or Sequential Order Numbers in WooCommerce

The first thing we need to understand when we talk about WooCommerce order numbers is that order numbers and order IDs are not the same but by default WooCommerce uses order IDs as order numbers 🙃

Order numbers in WooCommerce admin:

Order numbers in WooCommerce admin

Order IDs in the database:

Order IDs in WooCommerce database

So the ID is just a column in the database which we probably shouldn’t touch, but we can do whatever we want with order numbers using woocommerce_order_number filter hook. And yes, if see any plugin out there which allows to change WooCommerce order numbers in one or another way, most likely the plugin is just using the mentioned hook.

How to Delete a WooCommerce Order Programmatically

In this tutorial I would actually show you how to really delete a WooCommerce order programmatically, I mean because when I tried to find info about it, I only found recommendations about using wp_delete_post() function (which we can’t use it since HPOS appeared) or woocommerce_delete_shop_order() function (there is no such function).

I needed it when I was developing a synced order deletion feature for my Multisite Order Sync plugin.

The long story short, let’s just dive straight into it.