WooCommerce Auto Complete Orders

Today, I have consumed this space to convey how you can change WooCommerce Auto Complete Paid Orders programmatically. The program-based functionality is quite simple. There are seven default statuses available that can be used as per your requirements. So, let me explain with the help of an example:

$orderId = 10;
$orderDetail = new WC_Order( $order_id );
$orderDetail->update_status("wc-completed", 'Completed', TRUE);

Here is example of auto complete paid orders.

$orderId = 10;
$orderDetail = new WC_Order( $orderId );
if($orderDetail->get_status()=='processing') {
$orderDetail->update_status("wc-completed", 'Completed', TRUE);
}

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!