Created
March 21, 2017 20:26
-
-
Save brandalismo/6629f4be819314799225d297a3902563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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