久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

重命名 WooCommerce 訂單狀態(tài)

Renaming WooCommerce Order Status(重命名 WooCommerce 訂單狀態(tài))
本文介紹了重命名 WooCommerce 訂單狀態(tài)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號(hào)..

我想將 WooCommerce 訂單狀態(tài)從已完成"重命名為已收到訂單".我可以編輯下面位于 wc-order-functions.php 的腳本,但我不想修改任何核心文件或使用插件.

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 prefer not to modify any core files or use a plugin.

是否可以使用子主題的 functions.php 文件中的腳本覆蓋 woocoomerce 函數(shù)?

Is it possible to override woocoomerce functions with scripts in child theme's functions.php file?

function wc_get_order_statuses() {
  $order_statuses = array(
    'wc-pending'    => _x( 'Pending Payment', 'Order status', 'woocommerce' ),
    'wc-processing' => _x( 'Processing', 'Order status', 'woocommerce' ),
    'wc-on-hold'    => _x( 'On Hold', 'Order status', 'woocommerce' ),
    'wc-completed'  => _x( 'Completed', 'Order status', 'woocommerce' ),
    'wc-cancelled'  => _x( 'Cancelled', 'Order status', 'woocommerce' ),
    'wc-refunded'   => _x( 'Refunded', 'Order status', 'woocommerce' ),
    'wc-failed'     => _x( 'Failed', 'Order status', 'woocommerce' ),
  );
  return apply_filters( 'wc_order_statuses', $order_statuses );
}

推薦答案

只需將訂單狀態(tài)已完成"重命名為已收到訂單",這很簡(jiǎn)單,可以通過 wc_order_statuses 鉤子(您將此代碼段粘貼到您的活動(dòng)子主題 function.php 文件中):

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;
}

代碼位于活動(dòng)子主題(或活動(dòng)主題)的 function.php 文件中.經(jīng)測(cè)試有效.

Code goes in function.php file of your active child theme (or active theme). Tested and Works.

2018 年更新 - 要重命名,在訂單列表頁(yè)面:
? 批量操作下拉列表
? 訂單狀態(tài)標(biāo)簽(帶計(jì)數(shù))
請(qǐng)參閱:在 Woocommerce 中重命名多個(gè)訂單狀態(tài)

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

其他相關(guān)參考:如何創(chuàng)建自定義woocommerce 中的訂單狀態(tài)

這篇關(guān)于重命名 WooCommerce 訂單狀態(tài)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產(chǎn)品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產(chǎn)品的總訂單數(shù))
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗(yàn)證問題中添加自定義注冊(cè)字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡(jiǎn)單產(chǎn)品中添加一個(gè)將更改價(jià)格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產(chǎn)品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結(jié)帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 亚洲精品高清视频在线观看 | 91视频在线观看免费 | 亚洲精品久久久久久久久久久 | 久久久一区二区三区四区 | 国产在线一区二区三区 | 久草青青草 | 福利在线观看 | 成人亚洲视频 | 欧美一区二区三区视频在线播放 | 91在线精品播放 | 国产区精品视频 | 欧美精品在线播放 | 精品一级 | 91一区二区在线观看 | 亚洲三区在线观看 | 中文字幕视频一区 | 高清色视频| 成人国产综合 | 四虎海外 | 日韩欧美中文在线 | 超碰8| 中文天堂网| 国产99久久精品一区二区永久免费 | 午夜精品久久久 | 亚洲免费网 | 91资源在线| 蜜臀久久99精品久久久久野外 | 亚洲国产精品成人综合久久久 | 九九99久久 | 亚洲国产精品一区二区第一页 | 国产乱码精品1区2区3区 | 国产视频1 | 国产精品久久久久久久免费大片 | 天天久久 | 免费久久久 | 国产日韩欧美在线 | 中文字幕在线观看www | 国产1区| 91精品国产综合久久久久 | 日韩成人中文字幕 | 亚洲午夜久久久 |