Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Auto Complete all WooCommerce orders.
- */
- add_action( 'woocommerce_thankyou', 'dctit_custom_woocommerce_auto_complete_order' );
- function dctit_custom_woocommerce_auto_complete_order( $order_id ) {
- if ( ! $order_id ) {
- return;
- }
- $order = wc_get_order( $order_id );
- $order->update_status( 'completed' );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement