Update 'payment pending' order status after time limit reached
-
Hi,
I would like to remove the function which cancels pending payment orders after the time limit reached, but I would like it to cancel the order, (i.e. release held stock), and then change/udpdate order status to Updaid EFT.
I tried this but it does not work:
add_filter( 'wc_order_statuses', 'wpex_wc_add_order_statuses' ); if ( $unpaid_orders ) { foreach ( $unpaid_orders as $unpaid_order ) { $order = wc_get_order( $unpaid_order ); if ( apply_filters( 'woocommerce_cancel_unpaid_order', 'checkout' === get_post_meta( $unpaid_order, '_created_via', true ), $order ) ) { $order->update_status( 'wc-unpaideft', __( 'Unpaid EFT order - time limit reached.', 'woocommerce' ) ); } } }
Any ideas? Thanks! ??
- The topic ‘Update 'payment pending' order status after time limit reached’ is closed to new replies.