How to Rename Order Status Messages in WooCommerce

WooCommerce Rename Order Status MessagesAre you looking for a way to rename the order status messages in WooCommerce? This article will guide you on how to rename order status messages in WooCommerce.  For various reasons, you might want to include several different order statuses.

However, the default version of WooCommerce allows you to mark orders with one of the following statuses completed, processing, pending payment, on hold, refunded, canceled, or failed.

Plugin to Rename Order Status Messages

You might want to add order status names that fit the flow of your online store like “Awaiting shipment”, “Building”, or others to fit their fulfillment needs. However, WooCommerce has a solution for this problem with an extension called ‘WooCommerce Order Status Manager’ that is priced at $49.

WooCommerce order status manager

This might be an expensive solution for your store, but there is an easy way to do this. In the current version of WooCommerce, order statuses are saved as a custom post status, just like the draft, scheduled, or published for posts.

How to Rename Order Status Messages

With that said, let us look into renaming the order status messages in WooCommerce using a code snippet. To check the default order status messages, simply log into your WordPress site and access the Dashboard as the admin user. Then, click on WooCommerce > Orders. You will see this:

Default order statuses

Additionally, these messages are displayed in the front-end when a customer tries to place an order. This can be accessed by clicking on My Account > Orders as shown below:

front end view of the order statuses

Steps to Rename The Order Status Messages in WooCommerce

Follow these simple steps to rename the order status messages in WooCommerce:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will rename the order status messages in your WooCommerce store.
  3. Add the following code at the end of the php file and remember to save the changes:
add_filter( 'wc_order_statuses', 'ts_rename_order_status_msg', 20, 1 );

function ts_rename_order_status_msg( $order_statuses ) {

$order_statuses['wc-completed'] = _x( 'Order Received', 'Order status', 'woocommerce' );

$order_statuses['wc-processing'] = _x( 'Your Order is being processed', 'Order status', 'woocommerce' );

$order_statuses['wc-on-hold'] = _x( 'Your Order is on hold', 'Order status', 'woocommerce' );

$order_statuses['wc-pending'] = _x( 'Your Order is pending', 'Order status', 'woocommerce' );

return $order_statuses;

}
  1. To view the outcome, you need to access the order page in the back-end, by simply log into your WordPress site and access the Dashboard as the admin user. Then, click on WooCommerce > Orders. You will see this:changed order status name in the back-end

To access the front-end, simply click on My Account > Orders as shown below:changed order status name in the front-end

How The Code Works

In the example above, we have used the hook wc_order_statuses and  function ts_rename_order_status_msg to it. The status messages are contained in the $order_statuses array that we passed.

Additionally, there is an alternative method to display the order status messages. There two other places to do this: top menu inside the Admin Dashboard, and in the dropdown for Bulk Actions.

view

Steps to rename the order status messages in the top menu inside the Admin Dashboard, and the dropdown for Bulk Actions.

To rename the order status messages, simply follow these steps:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will rename the order status messages in your WooCommerce store.
  3. Add the following code at the end of the php file and remember to save the changes:
  4. foreach( array( 'post', 'shop_order' ) as $hook )
    
    add_filter( "views_edit-shop_order", 'ts_order_status_top_changed' );
    
    
    function ts_order_status_top_changed( $views ){
    
    if( isset( $views['wc-completed'] ) )
    
    $views['wc-completed'] = str_replace( 'Completed', __( 'Order Received', 'woocommerce'), $views['wc-completed'] );
    
    
    if( isset( $views['wc-processing'] ) )
    
    $views['wc-processing'] = str_replace( 'Processing', __( 'In Process', 'woocommerce'), $views['wc-processing'] );
    
    
    if( isset( $views['wc-on-hold'] ) )
    
    $views['wc-on-hold'] = str_replace( 'On hold', __( 'Order on Hold', 'woocommerce'), $views['wc-on-hold'] );
    
    
    if( isset( $views['wc-pending'] ) )
    
    $views['wc-pending'] = str_replace( 'Pending payment', __( 'Payment Pending', 'woocommerce'), $views['wc-pending'] );
    
    
    return $views;
    
    }

    To view the outcome, you need to access the order page in the back-end, by simply log into your WordPress site and access the Dashboard as the admin user. Then, click on WooCommerce > Orders. You will see this:top menu side

  5. If it is necessary to change the order status messages in the Bulk Actions dropdown that we highlighted, simply click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will rename the order status messages in your WooCommerce store.
  6. Add the following code at the end of the php file and remember to Save the changes:
add_filter( 'bulk_actions-edit-shop_order', 'ts_bulk_actions_order_status', 20, 1 );

function ts_bulk_actions_order_status( $actions ) {

$actions['mark_processing'] = __( 'Mark as In Process', 'woocommerce' );

$actions['mark_on-hold'] = __( 'Mark as Order on Hold', 'woocommerce' );

$actions['mark_completed'] = __( 'Mark as Order Received', 'woocommerce' );
return $actions;

}
  1. To see the outcome you need to access the order page in the back-end, by simply log into your WordPress site and access the Dashboard as the admin user. Then, click on WooCommerce > Orders. You will see this:view 2

How the code works

For the top menu inside the Admin Dashboard code, we have used views_edit-shop_order hook here to simply replace the String values that each array key contains. This is for different order status messages.

For the dropdown for Bulk Actions code, we have used the bulk_actions-edit-shop_orderhook is being used to change the values of the different actions that are applied to orders.

Renaming The Order Status Messages in WooCommerce Using a Plugin

If you are no that technical, you can do this by the use of a plugin. It is for those who are not familiar with customizing their site with code or maybe they do not want to mess up the coding structure of their site.

The plugin that we are going to use is the Custom Order Status for WooCommerce which you can download directly using this link here https://downloads.wordpress.org/plugin/custom-order-statuses-woocommerce.zip.

plugin

It is available at www.wordpress.org. To add this functionality, just follow these simple steps:

Steps to Rename The Order Status Messages in WooCommerce Using Free Plugin

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. Then, we are going to install the plugin that we have indicated earlier. If you have downloaded it using the link above, simply navigate to Plugins > Add New. After that, click on Upload Plugin and then Browse for the downloaded file as shown below:download plugin using link
  3. To download it directly in the Admin Panel, simply navigate to Plugins > Add New. After that, you will need to do a keyword search for the plugin ‘Custom Order Status for WooCommerce’. You need to install and activate it as shown below:downloading plugin directly
  4. To make the changes that you need simply click on WooCommerce > Settings > Custom Order Status as shown below:using the plugin
  5. Remember to save the changes that you make.

Conclusion

In this post, we have learned how to rename the order status messages in WooCommerce. Additionally, you can use your custom status message. Additionally, we have shown you how to do this using a plugin called Custom Order Status for WooCommerce.

Similar Reviews

Comments are closed.