Skip to content

Instantly share code, notes, and snippets.

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 wooexperte/3f30d2817c174c4ea8c8d4f613f69bf6 to your computer and use it in GitHub Desktop.
Save wooexperte/3f30d2817c174c4ea8c8d4f613f69bf6 to your computer and use it in GitHub Desktop.
WooCommerce Bestellung immer den Status "Fertiggestellt"
/**
* 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