admin管理员组文章数量:1130349
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 | Show 3 more comments1 Answer
Reset to default 1add_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' );
}
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
1 Answer
Reset to default 1add_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' );
}
本文标签: Change WooCommerce PayPal Builtin Default Order Status
版权声明:本文标题:Change WooCommerce PayPal Built-in Default Order Status 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749068333a2311175.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


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