Created
January 9, 2018 14:46
-
-
Save growdev/3cd6544b1ffca6cd730b914b8c880699 to your computer and use it in GitHub Desktop.
set orders to complete
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
<?php | |
add_filter( 'woocommerce_payment_complete_order_status', 'growdev_order_payment_complete_order_status', 10, 2 ); | |
function growdev_order_payment_complete_order_status( $order_status, $order_id ) { | |
$order = wc_get_order( $order_id ); | |
if ( 'processing' == $order_status && | |
( 'pending' == $order->status ) ) { | |
$order_status = 'completed'; | |
} | |
return $order_status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment