Skip to content

Instantly share code, notes, and snippets.

@rayflores
Created June 6, 2014 05:41
Show Gist options
  • Save rayflores/17f72d7aa01576110a3e to your computer and use it in GitHub Desktop.
Save rayflores/17f72d7aa01576110a3e to your computer and use it in GitHub Desktop.
<?php
/**
* Auto Complete all WooCommerce orders.
* Add to theme functions.php file
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
global $woocommerce;
if ( !$order_id )
return;
$order = new WC_Order( $order_id );
$order->update_status( 'completed' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment