I would like to rename the WooCommerce order status from \"Completed\" to \"Order Received\". I can edit the script below located in wc-order-functions.php, but I would pref
I had a similar wish, but for some reason Loic's solution did not work with my shop. So I want to share my simple solution.
With the free plugin LocoTranslate
you can easily rename the order status for your language. If your page needs no translation (i.e. it is in English), it might still be handy.
Simply create a totally new translation file and enter only the new order status replacing the original name. All other terms are not affected by this language file, if the fields stay empty (don't forget to activate this pseudo-translation in page settings).
This way, there is a good chance that WooCommerce
updates will not affect it.
Just renaming order status "Completed" to "Order Received", it's easy and can be accomplished this way with wc_order_statuses
hook (you will paste this snippet in your active child theme function.php
file):
add_filter( 'wc_order_statuses', 'wc_renaming_order_status' );
function wc_renaming_order_status( $order_statuses ) {
foreach ( $order_statuses as $key => $status ) {
if ( 'wc-completed' === $key )
$order_statuses['wc-completed'] = _x( 'Order Received', 'Order status', 'woocommerce' );
}
return $order_statuses;
}
Code goes in function.php file of your active child theme (or active theme). Tested and Works.
Update 2018 - To rename, in Order list page:
• the bulk actions dropdown
• the order status tabs (with the count)
See: Rename multiple order statuses in Woocommerce
Other related reference: How to create a custom order status in woocommerce
The accepted answer does a good job in most places, but the order status filter on the main order page is unaffected, as mentioned in one of the comments.
To update this you must also hook into the filter woocommerce_register_shop_order_post_statuses and update label_count like so:
// Rename order status 'Completed' to 'Order Received' in admin main view - different hook, different value than the other places
function wc_rename_order_status_type( $order_statuses ) {
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-completed' === $key ) {
$order_statuses['wc-completed']['label_count'] = _n_noop( 'Order Received <span class="count">(%s)</span>', 'Order Received <span class="count">(%s)</span>', 'woocommerce' );
}
}
return $order_statuses;
}
add_filter( 'woocommerce_register_shop_order_post_statuses', 'wc_rename_order_status_type' );
You will also need to update the string in the 'Bulk Actions' dropdown. Hooking into WordPress' gettext filter let's you do it, like so:
// Rename order status in the bulk actions dropdown on main order list
function rename_bulk_status( $translated_text, $untranslated_text, $domain ) {
if( is_admin()) {
if( $untranslated_text == 'Change Status To completed' )
$translated_text = __( 'Change Status To Order Received','woocommerce' );
}
return $translated_text;
}
add_filter('gettext', 'rename_bulk_status', 20, 3);
So add these to the accepted answer above so you have all 3 functions.