Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automatically change the status for an order placed with a Check or BACS gateway
<?php
// Automatically update the order status to "completed" for cheque orders
function skyverge_auto_complete_on_hold_order( $order_id ) {
$order = new WC_Order( $order_id );
if ( 'on-hold' === $order->status )
$order->update_status( 'completed' );
}
add_action( 'woocommerce_thankyou', 'skyverge_auto_complete_on_hold_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.