How to add custom action button in WooCommerce admin order list

Let’s add a new custom quick action button in the WooCoommerce admin order list. By default, WooCommerce will only show these action buttons when an order status is “Pending”, “On-hold” or “Processing”. It’s not very well documented in WooCommerce how to modify this; and the only thing I found was this StackOverflow thread. Here is … Read more

Guide to WooCommerce Order Status Change Hooks

Here are all the different action hooks you can use for WooCommerce order status changes. 1. woocommerce_order_status_$NAME This is the first action hook that fires when an order status is changed in WooCommerce. To use it, simply replace $NAME with the slug of the status name it is changing to. For the default WooCommerce statuses, … Read more

How to change order status in WooCommerce programmatically

For this week’s snippet, we will look at how to change the order status in WooCommerce programmatically. It is probably one of the more common tasks you will need to do when building custom functionality into WooCommerce. Luckily for us, it is super easy. WooCommerce provides a builtin function called update_status(). Here is the basic … Read more

How to add custom order status in WooCommerce

The default WooCommerce statuses available are Pending, Processing, On-hold, Completed, Cancelled, Refunded, and Failed. A common request is how to add a custom order status in WooCommerce. For stores selling physical products, it would be super useful to have a custom status such as “shipped”. If you are selling appointments, then maybe you want to … Read more

WordPress / Woocommerce hook on delete order (i.e. move to trash)

I needed to run a couple functions when a WooCommerce order was deleted / trashed using the admin edit order screen. I was looking for a specific WooCommerce hook, but then realized I just needed to use the default WordPress hook wp_trash_post and check for the post type (i.e. shop_order). Silly me. ‘wp_trash_post’ example snippet … Read more