How make “Processing” orders editable

WooCommerce has different order statuses that you can use to handle your workflow.

They are:

  • On Hold – The order is waiting for something, like a BACS payment.
  • Pending Payment – The order is waiting for the payment from an online payment gateway.
  • Processing – The order has been paid for and the admin is processing it.
  • Completed – The order has been shipped and completed.
  • Cancelled – The order has been cancelled by the customer or by the system for some reason.
  • Refunded – The order has been completely refunded. This is not used for partial refunds.
  • Failed – The order payment failed.

You can edit orders only when their status is On hold or Pending Payment. This is because the customer still needs to pay for that order, so it makes sense to accept changes for it.
Nobody would be happy to see their total amout changed after they paid.

But for any reason, you may need to allow Processing orders (in example) to be editable. How to do this?

Said. Done. Open your functions.php file located in wp-content/themes/your-theme-name/ and add this code at the end of the file:

add_filter( 'wc_order_is_editable', 'wc_make_processing_orders_editable', 10, 2 );
function wc_make_processing_orders_editable( $is_editable, $order ) {
if ( $order->get_status() == 'processing' ) {
$is_editable = true;
}
return $is_editable;
}
view raw functions.php hosted with ❤ by GitHub

This code checks the current order status. If it’s processing , it will be editable.

You can allow more order statuses to be editable copying the code from line 3 to 5 then pasting it just before line 7 and changing the order status in the if .


More Posts That You Might Like…


42 responses to “How make “Processing” orders editable”

  1. We understand that it’s not just about the financial transaction – it’s about your company’s reputation on the line. That’s why PayCanada is diligent about safeguarding your merchant service account and the POS payment processing.

  2. We are often faced with small changes and would love to edit an existing order.

    We had an order today for an item which we no longer sell. We were able to get the customer to substitute for a lower priced item, but we needed to edit their existing order.

    To do this and also process a partial refund with the same order, we did the following:

    add the new lower priced item to the order
    change the lower priced item’s price to the higher price
    delete the higher priced item (the one you are replacing)
    calculate the taxes
    calculate the total
    do a partial refund by editing the price and tax of the new item
    print the change off for your accountant (me, in my case)

    We don’t track inventory in woocommerce, so that wasn’t a worry here.

    Simple. Thank you! We tested it first before going live, but it worked great the first time so we had no problem copying the code to our live site.

    Thank you, Nicola! We don’t always need the snippets you provide, but we always enjoy the work you do!

  3. Perfect, thank you so much for this solution. Works very well.

    1. You’re welcome Ronald!

  4. We also need a way to be able to edit existing orders. It is not uncommon for a customer to call and want to add something to there order after the order is placed. We have no way to edit existing orders.

    1. Hi Mike,
      You can change this code:

      if ( $order->get_status() == 'processing' ) {
      

      to this:

      if ( $order->get_status() == 'processing' || $order->get_status() == 'completed'  ) {
      

      To allow also Completed orders to be edited.
      Also, you can always switch the order status to On Hold, make your changes, and then save it back with the previous status.

  5. Any idea on how to change an order from ‘processing’ to a custom one already created after x days?

    1. Hi Armoic,
      I’m not sure to understand your question in relation to this article. Can you please explain?

  6. Thank you so much! Really need this.

    1. You’re welcome!

  7. Thank you!! Works great.

    1. You’re welcome!

  8. Perfect!!Works Great!

  9. This may be a silly question but I would like to know how the payment works here? I mean, I have a processing order which means my client already paid for the product but I have to charge him an extra fee due he wants to exchange the product so he has to pay for the new shipping….if I edit his order…the extra price will automatically be charged? and if not…how can I do it?

    1. Im wondering the same thing.

      In the past ive used a bespoke system that allowed for this

      customer buys Product A for $10 and completes order through Payment gateway. Order #1001
      customer rings up and say, “oops, i need product B for $10 also”
      In admin I edit #1001 to add Product B.
      Order #1001 now shows and amount outstanding of $10
      Order #1001 can be resent to the payment gateway to add the extra $10 via credit card.
      the order is complete again.

      Fairly common workflow for most online business.

  10. Hi,

    is there a way to allow customer to edit their own order? I’m not conducting financial transactions, it’s more like a “rental” request, so I would like the ability for a client to edit their own request. So when they are in”My Account”, Orders, they can change destination address, and quantity of items.

    Thank you so much!

    1. Sorry but no, this is not possible. They will have to cancel their order and make a new one.

  11. Thank you Nicola!

    1. You’re welcome Nikki!

  12. Hi. I was wondering if you could guide me with a slightly different issue. I am testing a WooCommerce site using WooCommerce-Bookings plugin and the Accommodations plugin for booking hotels and tours online. This site will only be accessible to customers who are on our credit list and will not be making individual payments.

    I am using the Auto-Complete Orders option, with Check Payments as the default payment gateway, and bookings are working fine.

    However, In the invoice email generated to customer, the status is “Paid”. Same is the case in My Account, when I click on Bookings Menu on the left, it opens the list of bookings and status in each appears as “Paid”. Also, using the orders Menu on the left, if one clicks on a particular booking using View option, there also it appears as “Paid”.

    For all of these options, I want it to read “Credit Sale” instead of “Paid”.

    Any advice on resolving this would be highly appreciated.

    Many thanks in advance !

  13. Hi Nicola, my customer ordered and paid for 5 boxes subscription. Now she want add in one more box (have not paid). So I need to add in one more box into the existing order and she need to pay by credit card again for subscription. How can I do this? Please help me. Thanks a lot!

    1. Hi Rosa,
      I’m sorry that I missed your comment.

      In case you still need it, or for other readers, the best solution here would be to create manually a separate order with the new products and tell the customer to pay for that. You can send them a payment link (found in the order) or just tell them to go to My Account > Orders to find the payment link.

  14. Hi nicola i have another question , for example im not creating the order via frontend , but i wanna change te cost of the product there is a way to achieve that?
    thanks!

    1. if the question is not clear i wanna (edit,change) the price of the product in the order via backend . thanks for your time!!

    2. Hi felo,
      You can simply set the order status as On Hold and edit the product price in the items list.

      If you still don’t save the order and are in the process of creating it manually from the admin, you can edit the product price after adding it to the order.

  15. Thank you, this snippet helped me today!

    1. You’re very welcome!

  16. Great article, it is very useful code for my shop! Thanks!

    1. You’re welcome!

  17. Frederic D'Amours Avatar
    Frederic D’Amours

    Hi Nicola, how would solve the issue where I want each order to go automatically on hold after check-out. I don’t want payment to process automatically because I need to edit each order to add fees that I’m not able to manage other than manually. Once the order has been edited I would then flip the status to pending payment so the client is then taken to payment processing.

  18. Hi, is it possible to edit the price field too?

  19. Hi great snippet. Thanks.
    Can I ask a question? I am using a booking function to pre schedule and pay for tours and rentals in advance of desired date. I wish to also collect a deposit but I can only hold a deposit for 7 days so I need this charge to be part of the customer’s order but added after the original order is placed during a Processing order status. How can I collect a deposit and later refund a % or completely at order Completion Status based on any vehicle damage?

  20. I didn’t understand why this snippet not work on my site. Woocommerce 3.5.5

  21. I just wanted to tell you how grateful i am for this. I’ve looked in the past but couldn’t find a solution but this is perfect! Thank you!

  22. hi,

    thanks for this snippets. they are helpful. is there a way via snippet to allow customer complete the order itself. Scenario, we are sending the product and we put into processing, and we learn the order status from ship companies later and manually updating the order status. so that is why i’d like to allow to customer to change the order status from processing to completed.

  23. Awesome article! It is very useful for my shop! Thank you!

  24. Issue I have is the customer has paid, I try to add a shipping line or fee item, and the order will not accept or change upon clicking save. Issue?

  25. Fantastico!
    Thank you very much 🙂
    Guido

  26. How can I change this for pending payment ALONGSIDE the processing title?

  27. […] to Nicola Mustone’s article How make “Processing” orders editable, it’s as simple as adding this code to your theme’s […]

  28. eddieswelding2 Avatar
    eddieswelding2

    The code is working on my site for the processing status but not for a custom status I created. Am I doing something wrong? I copied the if statement and substituted my custom status but nothing. Any ideas?

Leave a Reply

Categories

Newsletter

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Blog at WordPress.com.

%d bloggers like this: