• Hello!

    I found some strange things on my WC-store. When the customer make an order system change status to “pending” with this hook:

    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
    function custom_woocommerce_auto_complete_order( $order_id ) {
        global $woocommerce;
         if ( !$order_id )
            return;
        $order = new WC_Order( $order_id );
        $order->update_status( 'pending' );
    }

    Then absolutely randomly system change one or more orders status back to “processing”. Usually that happens the next day.

    Any ideas?

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    That code is bad – pending = unpaid. Processing is correct after payment!

    Thread Starter juventino-40

    (@juventino-40)

    Mike, thanks for the fast answer! 😉

    I will give you working scheme of my store:

    1. Customers make an order and we give them an instruction of payment.
    2. Customers pay offline/online, but not via WC-store (payment method we used temporarily not working).
    3. Customer send us a screenshot of payment and we change order status to “processing”.
    4. We complete an order and send it to customer. Well done!

    So, how can I do that scheme? I need to set default status to “on-hold” and changed it manually to “pending” in order?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    You should make the gateway set it on-hold.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘System changes order status back to processing’ is closed to new replies.