• Resolved tchitcho30

    (@tchitcho30)


    Hello,

    I add the woocommerce code to automatically complete the orders after payment.

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

    Could you tell me if it’s possible to customize this code and only include ticket purchase, virtual product, downloadable product style orders.

    On the other hand, physical products must be in progress while I manage the order.

    Thanks for your help.

    Valerio

  • The topic ‘Woocommerce auto complete orders’ is closed to new replies.