Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Failed orders in WooCommerce to the order status of Pending
/**
* Set failed orders to pending payment.
*/
function wc_failed_to_pending( $order_id ){
$order = new WC_Order( $order_id );
$order->update_status( 'pending' );
}
add_action( 'woocommerce_order_status_failed', 'wc_failed_to_pending');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment