Created
November 2, 2018 08:22
-
-
Save wooexperte/3f30d2817c174c4ea8c8d4f613f69bf6 to your computer and use it in GitHub Desktop.
WooCommerce Bestellung immer den Status "Fertiggestellt"
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
/** | |
* WooCommerce Bestellung immer den Status "Fertiggestellt" | |
*/ | |
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); | |
function custom_woocommerce_auto_complete_order( $order_id ) { | |
if ( ! $order_id ) { | |
return; | |
} | |
$order = wc_get_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