Answers for "put woocommerce orders on pending payment automatically"

PHP
0

put woocommerce orders on pending payment automatically

add_action( 'woocommerce_thankyou', 'woocommerce_thankyou_change_order_status', 10, 1 );
function woocommerce_thankyou_change_order_status( $order_id ){
    if( ! $order_id ) return;

    $order = wc_get_order( $order_id );

    if( $order->get_status() == 'processing' )
        $order->update_status( 'pending' );
}
Posted by: Guest on June-24-2021

Code answers related to "put woocommerce orders on pending payment automatically"

Browse Popular Code Answers by Language