Renaming WooCommerce Order Status

后端 未结 3 1392
半阙折子戏
半阙折子戏 2020-12-31 17:55

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

3条回答
  •  臣服心动
    2020-12-31 18:23

    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

提交回复
热议问题