70
If you wish to mark paid orders as “Completed” automatically (i.e. without having to manually login to the site and “check” processing orders one by one), you can use the code below.
What is more, this snippet will completely skip the “Processing” order status transition, which means no “Order Processing” email notification will trigger either. Once again, these 4 lines of code could save you millions of hours… hope this helps!
PHP Snippet: Autocomplete WooCommerce Paid Orders
/**
* @snippet Programmatically Complete Paid WooCommerce Orders
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @testedwith WooCommerce 3.8
* @donate $9 https://tutoraspire.com
*/
add_filter( 'woocommerce_payment_complete_order_status', 'tutoraspire_autocomplete_processing_orders', 9999 );
function tutoraspire_autocomplete_processing_orders() {
return 'completed';
}