Reserve Your Free Seat for Our Next WooCommerce Class! Search
Business Bloomer
  • Business Bloomer Club
  • WooCommerce Plugins
  • WooCommerce Tips
  • Log In
  • 0
  • Business Bloomer Club
  • WooCommerce Plugins
  • WooCommerce Tips
  • Log In
  • Search
  • Contact
  • Cart
WooCommerce Code Snippets My Account Order Order Status

WooCommerce: Let Customers Complete a Processing Order

Last Revised: May 2022

STAY UPDATED

An order can be marked as “completed” only by the WooCommerce store manager – manually. In certain cases, this operation may be automatic i.e. for downloadable orders.

However, what if we want our customers to complete (confirm) their processing order instead? Well, this is quite easy: we display a “CONFIRM ORDER” button under My Account > Orders, and on click some code triggers the status change. Enjoy!

If the order is in “processing” status, the customer now sees a new “Confirm Order” button. On click, the order is automatically marked as “completed”!

PHP Snippet: “Confirm Order” Button @ My Account > Orders

/**
 * @snippet       Confirm Order Button | WooCommerce My Account
 * @how-to        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @testedwith    WooCommerce 6
 * @community     https://businessbloomer.com/club/
 */

add_filter( 'woocommerce_my_account_my_orders_actions', 'bbloomer_confirm_order_my_account_orders_actions', 9999, 2 );
  
function bbloomer_confirm_order_my_account_orders_actions( $actions, $order ) {
    if ( $order->has_status( 'processing' ) ) {
        $actions['confirm-order'] = array(
            'url'  => wp_nonce_url( add_query_arg( array( 'confirm_order' => $order->get_id() ) ), 'woocommerce-confirm-order' ),
            'name' => __( 'Confirm Order', 'woocommerce' )
        );
    }
    return $actions;
}
  
add_action( 'template_redirect', 'bbloomer_on_confirm_order_click_complete_order' );
   
function bbloomer_on_confirm_order_click_complete_order( $order_id ) {
	if ( isset( $_GET['confirm_order'], $_GET['_wpnonce'] ) && is_user_logged_in() && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), 'woocommerce-confirm-order' ) ) {
        $order = wc_get_order( $_GET['confirm_order'] );
		$order->update_status( 'completed', 'Order confirmed by customer' );
    }
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Separate Login, Registration, My Account Pages
    There are times when you need to send logged out customers to a Login page and unregistered customers to a standalone Register page. As you…
  • WooCommerce: Add New Tab @ My Account Page
    One of the features of Business Bloomer Club is the provision of Premium WooCommerce Q&A Support to supporters who enroll. So, how to add an…
  • WooCommerce: How To Make A Website GDPR Compliant? (12 Steps)
    Ok, we all know that the EU General Data Protection Regulation (GDPR) will come into force on the 25th May 2018. So the main question…
  • WooCommerce: How to Add a Custom Checkout Field
    Let’s imagine you want to add a custom checkout field (and not an additional billing or shipping field) on the WooCommerce Checkout page. For example,…
  • WooCommerce: Get Order Data (total, items, etc) From $order Object
    As a WooCommerce development freelancer, every day I repeat many coding operations that make me waste time. One of them is: “How to get ____…

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

8 thoughts on “WooCommerce: Let Customers Complete a Processing Order”

  1. huo
    December 5, 2024

    Thank you for your code, it works fine. Can you show this button when viewing the order page? Thank you.

    Reply
    1. Rodolfo Melogli
      December 11, 2024

      Huo, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  2. Brad
    July 9, 2024

    Hello, thanks, this worked very well. I have a scenario where I have a “Ready For Pickup” custom status, and another custom status called “Ready For Pickup – Reminder”. I made a change to the slug in the OG code and got it to work for one or the other statuses, but I would like to set this up for both. I tried adding a second cloned snippet and changing the order status slug, but it will not activate. Is there a way to add both status triggers in the same code snippet?

    Thanks in advance.

    Reply
    1. Rodolfo Melogli
      July 11, 2024

      Brad, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
  3. William Adama
    August 4, 2022

    Hello, Rodolfo. Great work as always!
    I’m trying to create a button “Click me to complete this order” and place this on a private page, on the frontend, that managers have access. I already have the order object on this page. Any idea on how to run the

    "$order->update_status( 'completed');

    on the click of a button?
    Thank you!

    Reply
    1. Rodolfo Melogli
      August 4, 2022

      Hi William, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

      Reply
      1. max
        November 3, 2022

        How much would such a solution cost?

        Reply
        1. Rodolfo Melogli
          November 30, 2022

          Hi Max, thanks so much for your comment! If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

          Reply
Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Cancel reply

Your email address will not be published. Required fields are marked *


Search WooCommerce Tips

Popular Searches: Visual Hook Guides - Checkout Page - Cart Page - Single Product Page - Add to Cart - Emails - Shipping - Prices - Hosting

Recent Articles

  • WooCommerce: How to Configure Product and Order Sync
  • WooCommerce: “Beautify” Item Meta in Order Emails
  • WooCommerce: Per-Product Checkout Fees / Tariffs
  • WooCommerce: Auto-Cancel Orders After 3 Failed Payments
  • WooCommerce: Bulk Delete Pending / Failed Scheduled Actions

Latest Comments

  1. Tiago Sartor on WooCommerce: Access Thank You Page from Order Admin
  2. Piotr on WooCommerce: Replace Variable Price With Active Variation Price
  3. Rodolfo Melogli on WooCommerce: Redirect Empty Paginated Category Pages (404)

Find Out More

  • Become a WooCommerce Expert
  • Business Bloomer Club
  • WooCommerce Blog
  • WooCommerce Weekly
  • Contact

Contact Info

Ciao! I'm Rodolfo Melogli, an Italian Civil Engineer who has turned into an international WooCommerce expert. You can contact me here:

Twitter: @rmelogli

Get in touch: Contact Page

Business Bloomer © 2011-2025 - VAT IT02722220817 - Terms of Use - Privacy Policy

Cart reminder?

x