WooCommerce extension updates & releases

WooCommerce Order Status Manager 1.3 was released a few days ago! This update brings a few more interesting features that we think you are going to like.

Mark Order Statuses as Paid

You can now mark statuses as “Paid”. This denotes a status that an order should have after a payment has occurred. Default core statuses such as “Completed” and “Processing” will already have this flag, of course. You can set it for your  own custom statuses by editing an individual order status. The option to tick is right below the other check-boxes to add the status to bulk actions or include it in reports.

WooCommerce Order Status Manager Edit Status

Besides being of semantic usefulness to admins or shop managers, marking order statuses as “Paid” will also produce a few effects for the end user, such as showing downloads (if enabled after purchase) and purchase notes to the customer. – Purchase notes require WooCommerce 2.5+ to be shown with paid statuses. Remember, WooCommerce 2.5 is coming soon in January 2016!

WooCommerce Order Status Manager Paid status

Reassign Deleted Statuses

What if you wanted to delete a custom status but there are many orders marked with such status? Until now, when you deleted a status that had associated orders, such orders would have been automatically marked as “On hold”. We realized this wasn’t always optimal for some shop managers, especially for stores with hundreds or thousands of orders affected by the status change.

With 1.3 you are now prompted to confirm and choose between two actions when you attempt to delete a custom order status that has orders assigned to it. You can either choose to “just delete” it – then the previous behavior will be retained (affected orders will be marked as “On hold”) – or you can choose which status these orders should be assigned to. You can choose any core or custom status. A note will be added to the affected orders with a memo of this change.

WooCommerce Order Status Manager delete status

Sort Order Statuses by drag and drop

You can now drag and drop statuses (custom and core alike) and rearrange them in the order status table. The sort order will be retained in lists and select dropdowns where the statuses are displayed elsewhere. A small touch, but hopefully convenient and appreciable by those who like organization and tidiness as we do 🙂

WooCommerce Order Status manager status list

Status Descriptions in Recent Orders table

Previously, we featured statuses descriptions to be displayed in tooltips when their names are hovered in the “View Order” screen in the user “My Account” area. However we didn’t offer the same behavior in the “Recent Orders” table in the “My Account” page itself. We have now added this tweak, although, due to WooCommerce own templates, tooltip descriptions can be shown here only from WooCommerce 2.5 onwards.

WooCommerce Order Status Manager recent orders

Importing Custom Statuses

Order Status Manager previously had a feature to automatically import custom order statuses added by other plugins such as WooCommerce Pre-Orders or via custom code, but saw conflict with several plugins that filtered pre_get_posts improperly.

We have adjusted this to now require a manual action to import order status to avoid automatically listening for new statuses. You will find a button on the left bottom of the order status table. After activating Order Status Manager, if you see any missing statuses in the list, you can click this button to import them. Likewise, if you install a new extension that is expected to add new statuses but you don’t see them, you can click the “Import custom statuses” button to import them.

This is a one-time operation that you won’t have to repeat it again for the same statuses to be imported. Also, if you accidentally click the button and there are no statuses to be imported, then nothing would happen.

WooCommerce Order Status Manager import statuses

Other changes

There are a few other changes in this release, which you can find listed in the official changelog.

Most notably, we introduced two filter hooks:

  • wc_order_status_manager_order_status_name
  • wc_order_status_manager_order_status_description

which could aid localizing order status names and descriptions (the only two strings of text that appear in front end and emails), with or without the support of multilingual plugins.

Published by Fulvio Notarstefano

Fulvio is a WordPress engineer, and spends most of his time on new plugin development and updating existing plugins. You'll find him on the SkyVerge blog keeping you in the loop on what's new with our plugins, along with helping in your support threads.

15 Comments

  1. Can we use filters to translate order statuses? Using standard translations is not good as order page is not multilanguage and statuses translated with WPML are listed in all languages in bulk actions dropdown.

    If the answer is yes, how could we use the filter?

    • Hello Diego,

      if you want to translate a custom status name using the newly introduced filter, you can do like so:

      Let’s assume you have created a custom status with Order Status Manager called ‘my-custom-status’ with name ‘My Custom Status’
      You can put a filter in your functions.php file or equivalent like this:

      function my_custom_order_status_name_language_filter( $original_name, $status ) {
      
          // This will return the current language (for example: 'en-US')
          $language = get_bloginfo( 'language' );
      
          if ( $status == 'my-custom-status' ) {
      
              switch ( $language ) {
      
                // Spanish language code
                case 'es-ES' :
                     return 'Mi estado personalizado'
      
                case 'en-US' :
                default :
                    return $original_name;
      
               }
      
           }
      
          return $original_name;
      
      }
      add_filter( 'wc_order_status_manager_order_status_name', 'my_custom_order_status_name_language_filter', 10, 2 );
      

      The inner part of this hook callback function my_custom_order_status_name_language_filter() can be done differently, depending on your setup, on how you switch between languages, on which languages you want to cover, on your custom statuses, etc.

      WPML should have been notified of our newly introduced filters and perhaps in the future they will update their WooCommerce integration plugin to avoid the duplicates you mentioned.

      Hope this answers to your question — if not just let me know 🙂

      Cheers!

  2. Hello Fulvio,
    I noticed in plugin code also this filter:

    wc_order_status_manager_order_status_email_body_text_{$this->id}

    can i use this to change the mail body accordingly to WPML site language?

    if yes, could you give me a hint on how?

    Thanks

    • But when the changing status automatic emails are sent from the website to a customer, how it is possible that they are sent in the language the customer used to make a purchase?

    • Hello there again, Diego!

      how is it going with the plugin after all these months? 🙂

      Yes you could use this filter to dynamically change the content (and thus the language) of the body text of an email. If you look at the comment above, I think you could use a similar approach for this filter. You need to replace the {$this->id} part with the ID of the email of the corresponding custom status you have added.

      For the callback you could have something similar as in wc_order_status_manager_order_status_name as in the example in the older comment above.

      As for your other question in your other comment here – “how to retrieve the user language of preference” – if I am not mistaken WPML saves this information in a user meta called icl_admin_language – so from your callback you could use the last (2nd) argument passed to that filter which contains the order; from the order you can get the customer (user) id from and so you can finally retrieve this user meta set by WPML.

      You could write to WCML support asking if they can add support for Order Status Manager https://wordpress.org/plugins/woocommerce-multilingual/ – I checked and with WPML alone you can have the order email translated from within the wp admin interface; the issue of course is that this doesn’t check the language preference of the customer.

      Hope that helps,

      Fulvio

  3. Hello Fulvio,
    the plugin is doing great, I’ve only serious trubles translating statuses and customized emails with WPML, I posted both on WC forum and on WPML support, but.. you know… “please remove all plugins except this and revert to default theme”… it’ usually a long process.
    So I would like to cut the process and translate all with filters without bothering WPML.

    When you say
    “replace the {$this->id} part with the ID of the email of the corresponding custom status you have added”
    you mean this? –< http://prntscr.com/d7k0kx

    PS: the postmeta of WPML language stored in orders is “wpml_language” 🙂

    • yes 🙂 sorry I didn’t clarify; since Order Status Manager emails are created dynamically we use custom post types for that, and the ID is the id of the matching post as you found out

      • Thanks for your help Fulvio, but it looks like I’m not able to make that filter on the body text why is this not working?

        add_filter(‘wc_order_status_manager_order_status_email_body_text_4691’, ‘wc_order_status_manager_order_spedito’, 99, 2);

        function wc_order_status_manager_order_spedito($body_text, $order){

        return 'anything';

        }

        • Oh sorry Diego, I double checked, it should be:

          "wc_order_status_manager_order_status_email_body_text_wc_order_status_email_4691"

          Order Status Manager prefixes the post id here with wc_order_status_email_ – I’ll ask someone in my team to revise the documentation since this might not be intuitive

          Please let me know if this works out

          Thanks and sorry for that

          Fulvio

          • LIke this it’s working, thanks!

            but how to translate mail subject and headline too?

            PS: where is the documentation you’re speaking about? I just found the hooks looking at the code.

          • Nevermind, I found! 🙂 Thanks!

            Subject hook:
            woocommerce_email_subject_wc_order_status_email_4691

            Heading hook:
            woocommerce_email_heading_wc_order_status_email_4691

  4. does this allow me to have icons show up under the “Actions column” in order to allow rapid order status changes to orders with new custom statuses?

    I don’t see where in here you can specify that icons are added/available in the Action column.

    Please advise.

    danke

    -Erich..//

  5. So I ended up coming across some information about this on a support forum.

    I guess I’ll make a wee suggestion that you include screen shots of how you easily enable ‘next action’ on the back end to accomplish what I was concerned was not a basic default feature….

    my bad 🙂

    Happy new year ! 🙂

    ENB..//

    • Hey Erich, glad to hear it sounds like your question was answered, and happy new year to you as well! I’ll iterate for others that find this thread — you can set icons for both the status and the “actions” column when adding / editing your new status as seen here, and we’ll look at incorporating your suggestion to the documentation as well.

  6. We are using shipStation which maps order status to their system. When an order is placed we authorize the charge only which puts the order in the “On Hold” status until the order is shipped. Once shipped ShipStation connects to WooCommerce to mark an order as closed where we have a function that captures the funds when that happens. (Thanks to Beka’s library of useful functions).

    The client would like to modify the “On Hold” Status to something like Shipment Pending as “On Hold” sounds like something is wrong possibly with the credit card payment. Have you had any issues that you are aware of with this extension and mapping to other services?

    Thank you!

    John

Hmm, looks like this article is quite old! Its content may be outdated, so comments are now closed.