Comments 6Min Tran started the conversationJuly 27, 2023 at 7:47amI need that after an order of a subaccount is approved, its status will become "Processing" in steads of "Pending Payment" because our business policy is payment on delivery.According to your documentation. It's only set to Pending Payment.Company Order Approval - B2BKing (woocommerce-b2b-plugin.com)I've tried this code snippet but it does not work:add_action( 'woocommerce_order_status_pending', 'changing_order_status_after_approval', 10, 3 );function changing_order_status_after_approval( $order_id, $posted_data, $order ){ $order->update_status( 'processing' );}Please help.Thank you!Attached files: Untitled121212.png 2,285WebWizards repliedJuly 27, 2023 at 1:23pmHi Min,You can add this PHP code snippet to your site: add_action('b2bking_after_approve_order', function($order){ $order->update_status( 'processing', esc_html__( 'Order approved.', 'b2bking' ) ); $order->save(); }, 10, 1); It should set the order to "processing" after it's approved.Let me know if you have any issues with that,Kind regards,Stefan 6Min Tran repliedJuly 30, 2023 at 11:26pmIt works excellently as I expect.Thank you so much, Stefan.1 Like Sign in to reply ...
I need that after an order of a subaccount is approved, its status will become "Processing" in steads of "Pending Payment" because our business policy is payment on delivery.
According to your documentation. It's only set to Pending Payment.
Company Order Approval - B2BKing (woocommerce-b2b-plugin.com)
I've tried this code snippet but it does not work:
add_action( 'woocommerce_order_status_pending', 'changing_order_status_after_approval', 10, 3 );
function changing_order_status_after_approval( $order_id, $posted_data, $order ){
$order->update_status( 'processing' );
}
Please help.
Thank you!
Attached files: Untitled121212.png
Hi Min,
You can add this PHP code snippet to your site:
It should set the order to "processing" after it's approved.
Let me know if you have any issues with that,
Kind regards,
Stefan
It works excellently as I expect.
Thank you so much, Stefan.