• Resolved billyf

    (@excited4coupons)


    I added this code on the site below and It still did not change my orders to completed. I am using events ticket plus with woo. It still keeps the order as processing. I am using paypal standard. Latest WP and plugins.

    https://docs.woocommerce.com/document/automatically-complete-orders/

    Strange I used the Code snippets plugin and it worked. Not sure why it didnt work if I added it to the functions.php file.

    Any ideas ?

    • This topic was modified 5 years, 12 months ago by billyf.
Viewing 3 replies - 1 through 3 (of 3 total)
  • That may be due to it not running in the right sequence of execution. You could try putting the functions.php snippet inside the add_action( 'woocommerce_init, 'my_function' ); hook to make sure WooCommerce has loaded.

    Thread Starter billyf

    (@excited4coupons)

    How would it look like with the code thats in the URL ?

    add_action( 'woocommerce_init, 'my_function' );
    function my_function() {
      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' );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Make orders Completed not working’ is closed to new replies.