Skip to content

Instantly share code, notes, and snippets.

@brandalismo
Created March 21, 2017 20:26
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 brandalismo/6629f4be819314799225d297a3902563 to your computer and use it in GitHub Desktop.
Save brandalismo/6629f4be819314799225d297a3902563 to your computer and use it in GitHub Desktop.
/*
* FINALIZAR LOS PEDIDOS AUTOMÁTICAMENTE
*/
function woo_auto_complete_order( $order_id ) {
global $woocommerce;
if ( ! $order_id ) { return; }
$order = new WC_Order( $order_id );
$order->update_status( 'completed' );
}
add_action( 'woocommerce_thankyou', 'woo_auto_complete_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment