Typically with eCommerce payment is collected, well, electronically. Sometimes though, you need to collect cash in hand, which is why WooCommerce comes with the Cash on Delivery gateway.

Typically if this gateway is used with WooCommerce Bookings, the bookings created will sit in an Unpaid status until they are manually updated by the store admin. Where this works for some, it does not work for all. So here comes the star of this post, the snippet:

This snippet takes code straight from Bookings itself and processes orders a second time only if they have COD as their payment method. It will put the associated bookings into a Confirmed status automatically. It also includes a filter to check to make sure the booking hasn’t already been set to Paid or Completed to make sure those statuses stay intact.