Last active
August 29, 2015 14:19
-
-
Save WebEndevSnippets/f302e3452499fad6decc to your computer and use it in GitHub Desktop.
Autocomplete all Woocommerce Paid Orders
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
add_filter( 'woocommerce_payment_complete_order_status', 'bryce_wc_autocomplete_paid_orders' ); | |
/** | |
* Add login/logout and registration links to header menu | |
* | |
* @author Bryce Adams | |
* @link http://bryceadams.com/autocomplete-orders-woocommerce/ | |
* | |
*/ | |
function bryce_wc_autocomplete_paid_orders( $order_status, $order_id ) { | |
$order = wc_get_order( $order_id ); | |
if ( $order_status == 'processing' && ( $order->status == 'on-hold' || $order->status == 'pending' || $order->status == 'failed' ) ) { | |
return 'completed'; | |
} | |
return $order_status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment