Change WooCommerce PayPal Built-in Default Order Status

admin2025-06-05  1

I want to change the default status the built in PayPal gateway in WooCommerce . Currently, when a new order is created, it's updating to 'processing'. I want to change it but I can't see anywhere to change it, not in the WooCommerce -> Payments settings and not in the code (probably I just missed it).

Does anyone knows where it is?

Thanks.

I want to change the default status the built in PayPal gateway in WooCommerce . Currently, when a new order is created, it's updating to 'processing'. I want to change it but I can't see anywhere to change it, not in the WooCommerce -> Payments settings and not in the code (probably I just missed it).

Does anyone knows where it is?

Thanks.

Share Improve this question edited Dec 26, 2018 at 8:07 butlerblog 5,1413 gold badges28 silver badges44 bronze badges asked Dec 24, 2018 at 10:38 OmerOmer 1491 gold badge4 silver badges14 bronze badges 8
  • please check the link i hope solve your problem : angelleye/… – vikrant zilpe Commented Dec 24, 2018 at 10:40
  • As I understands it talks about the PayPal integration. I am using the WooCommerce Built-in PayPal gateway, will it still work? – Omer Commented Dec 24, 2018 at 10:43
  • not clear your question for me please explain to me i help you – vikrant zilpe Commented Dec 24, 2018 at 10:59
  • I am using the PayPal gateway that comes with WooCommerce. Apparently it's called PayPal Standard. – Omer Commented Dec 24, 2018 at 11:04
  • I'm not sure I understand you. Currently, when an order is created through the PayPal gateway, the new order status will be processing. I want to change it so it will be set to a custom status I have created. – Omer Commented Dec 24, 2018 at 11:08
 |  Show 3 more comments

1 Answer 1

Reset to default 1
add_action( 'woocommerce_thankyou', 'change_order_status', 10, 1 );
function change_order_status( $order_id ){
     if( ! $order_id ) return;
     $order = wc_get_order( $order_id );
     if( $order->get_status() == 'processing' )
     $order->update_status( 'pending' );
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749068358a316078.html

最新回复(0)