Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

auto complete order

/**
 * 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' );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #auto #complete #order
ADD COMMENT
Topic
Name
7+9 =