Support » Plugin: WooCommerce Autocomplete Orders » Nothing happens – virtual products not set as completed

  • Resolved brianbrandt

    (@brianbrandt)


    Hi

    I’m not sure if I have to do anything else, than install the plugin.

    I did that – and my products are “virtual” – but still it does not work..

    I tried using the code from Woocommerce themselves:

    /**
    * Auto Complete all WooCommerce orders.
    * Add to theme functions.php file
    */
    
    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( 'completed' );
    }

    That works. But I don’t want it to complete orders automatically on products that are NOT virtual. And the above code does it on all orders / products.

    What can I do to make this work ?

    / Brian

    http://wordpress.org/plugins/woocommerce-autocomplete-order/

Viewing 1 replies (of 1 total)
  • Plugin Author Mirko Grewing

    (@rashef)

    Hello,

    sorry for the late reply:

    1. are products set just to virtual?
    2. is the payment immediate (e.g. PayPal or Credit Card)?
    3. what is the status of these orders?

    Cheers

Viewing 1 replies (of 1 total)
  • The topic ‘Nothing happens – virtual products not set as completed’ is closed to new replies.