woocommerce Automatically Complete Orders, How To Complete WooCommerce Order Automatically After Successful Payment

 

woocommerce Automatically Complete Orders, How To Complete WooCommerce Order Automatically After Successful Payment



Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.


You could also change the “Completed” status to be another order status, like “Processing”



As a WooCommerce store owner, you should strive to improve customer experience as much as possible. One of the effective measures that could help you achieve that is to optimize the WooCommerce checkout process.

With this in mind, in today’s article, we will give you comprehensive instructions on how to autocomplete orders in WooCommerce.

Why Do You Need to AutoComplete Orders in WooCommerce?
       

/**
 * Auto Complete all WooCommerce orders by rakib hossain sojol
 */
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' );
}

       
 
  • If your customers want your product immediately, keeping the order pending for hours or even days before it is verified would certainly cause them to cancel the order before payment has been made.
  • Enabling the autocompletion of orders in your WooCommerce store allows you to process and complete orders quickly, enabling your customers to access their items in just a few minutes.
  • Not only will autocompleting orders save you time and labor, but it will also speed up the checkout process and increase your revenues, especially if you offer virtual or downloadable products.

Customers’ overall shopping experience will improve.

How to AutoComplete Orders in WooCommerce?
In this part, we will show you how to autocomplete WooCommerce orders. In general, there are two methods that you can approach, namely, using a plugin and using PHP code snippets.


Post a Comment

Previous Post Next Post

POST ADS1

POST ADS 2