Skip to content

Instantly share code, notes, and snippets.

@maxrice
Created October 1, 2013 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxrice/6772280 to your computer and use it in GitHub Desktop.
Save maxrice/6772280 to your computer and use it in GitHub Desktop.
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