Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Autocomplete all Woocommerce Paid Orders
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
You can’t perform that action at this time.