• Resolved GDU

    (@gettingdownunder)


    Hi Folks, I have a scenario where payments are confirmed; however, the status remains as processing.

    Searching these forums flags a snippet from @rainfallnixfigthat, which, based on the feedback, will fix my problem. However, the link: https://woocommerce.com/document/automatically-complete-orders/ now goes to a 404 error, and searching the Woocommece website for “automatically Complete Orders” draws blanks.

    Does anyone have the snippet in question please?

    Thanks in advance

    • This topic was modified 11 months, 2 weeks ago by GDU.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Archive.org is your friend ??
    The code from the page in question:

    /**
     * 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' );
    }

    Hello @gettingdownunder,

    I apologize for the inconvenience caused due to the broken link. It seems the document you’re referring to might have been moved or deleted. However, I can help you with the issue you’re facing.

    From your description, I can recommend the WooCommerce Order Status Control plugin which will automatically complete orders based on the type of products you are selling.

    You can also refer to the snippet shared by the community member @virtz.

    Please be sure to have a full site backup before adding any custom code snippets to your site.

    I hope this helps.

    Thread Starter GDU

    (@gettingdownunder)

    All good, thanks for your help and thank you @virtz for the snippet! Much appreciated ??

    Hi @gettingdownunder,

    Glad to hear it – thanks for letting us know!

    I’ll mark this thread as resolved now. If you have a few minutes, we’d love if you could leave us a review.

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Set order complete rather than processing’ is closed to new replies.