Support » Plugin: WooCommerce » Woocommerce orders COMPLETE status on their own

  • Resolved johnbretel

    (@johnbretel)



    I added the code below in the function.php child theme to have my Woocommerce orders status directly set to COMPLETE but this code prevented another woocommerce plugin from working properly. so i removed it from the function.php file completely, however the status of new order still are set to COMPLETE and i cant understand why its still doing that, is the function.php file somehow cached? is there a way to flush the cache? or did this code make permanent changes elsewhere on my site that i need to revert maybe?

    /*
     * Auto Complete all WooCommerce orders.
    */
    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
    function custom_woocommerce_auto_complete_order( $order_id ) { 
        if ( ! $order_id ) {
            return;
        }
    
        $order = wc_get_order( $order_id );
        $order->update_status( 'completed' );
    }

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Andrew

    (@slash1andy)

    Automattic Happiness Engineer

    If your items are variable and downloadable, then it would automatically complete, no need for any other code or anything. Is that what your items are? That would explain it.

    Plugin Support yukikatayama

    (@yukikatayama)

    Automattic Happiness Engineer

    Hi there!

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread with further details to the issue.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.