1

I use WooCommerce order status manager which is interfering with statuses but i do not use any custom codes, only for attaching pdf to email and for adding information to BACS payments which should not be a problem.

I am using WooCommerce: Auto complete paid orders answer code to change the order status to a custom status, with the following code:

add_action( 'woocommerce_payment_complete_order_status', 'change_status_of_paid_orders', 10, 3 );
function change_status_of_paid_orders( $status, $order_id, $order ) {
    return 'card-on-hold';
}
    

But problem is, that it takes several minutes to change the status and sometimes it will not be triggered at all.

I am not programmer and I do not know how to troubleshoot my issue, therefore I am asking for help or some directions.

My order statuses are for:

  • new COD order: processing,
  • new BACS order: on-hold,
  • new CARDPAY order: custom status card-on-hold.

I tried to change priority to 9, 2 but it did not help it was not even triggered.

Thank you for any help.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
RaDium
  • 37
  • 5
  • 1
    This problem can be related to your theme, to a third party plugin, to your hosting or to some custom code you added… So It's not possible to guess and to find out what is making trouble in your case. – LoicTheAztec Jan 30 '21 at 15:00
  • i do not have any custom code related to status changes, theme which i use is betheme and i do not think that problem can be theme, hosting is not the problem for sure, issue can be plugin order status manager which is set for our need and is changing statuses as i did describe in the post. how to troubleshoot my issue? – RaDium Jan 30 '21 at 17:51
  • i did test basic code which returns status completed and it was working straight away without any issues. then it looks like issue is only my custom status card-on-hold. what can be an issue here? status was created with orders status manager plugin from skyverge. – RaDium Jan 31 '21 at 23:45
  • Contact the plugin support and open a ticket. – LoicTheAztec Jan 31 '21 at 23:48
  • i would like to know if solution would also be: 1. as LoicTheAztec stated in original post "As you can see, by default the allowed paid order statuses are "processing" and "completed". so my custom status is definitelly not allowed status. How to add my custom status to allowed statuses so it would work? 2. Would workaround with add_filter('woocommerce_order_item_needs_processing', '__return_false',999); work? using this hook and then hooks for orders which status was chaning for processing. In my case 2 order types, COD and card pay where i would use just simple hook with status_update. – RaDium Feb 01 '21 at 09:21
  • Maybe it could be done using 2 hooks or one of them? woocommerce_valid_order_statuses_for_payment woocommerce_payment_complete_order_status any ideas? – RaDium Feb 08 '21 at 10:39

0 Answers0