当前位置:网站首页 > WordPress教程 > 正文
给WooCommerce订单添加一个正在运输中的状态
作者:98wpeu发布时间:2026-02-13分类:WordPress教程浏览:5
导读:我们知道,可以通过WooCommerce搭建自己的跨境电商独立站,而默认的WooCommerce订单状态只有Completed已完成、Processing处理中、Onhold保留...
我们知道,可以通过WooCommerce搭建自己的跨境电商独立站,而默认的WooCommerce订单状态只有Completed已完成、Processing处理中、On hold保留和Cancelled已取消这几种状态,我们做跨境订单的时候物流时间会比较久,如果按照正常的显示Processing处理中对用户来说可能会造成困扰,而如果我们新增加一个运输中的状态,就会更好友好。
想要给WooCommerce的订单添加额外的自定义状态可以通过插件或者代码的方式来处理。
使用插件添加自定义订单状态
Custom Order Status for WooCommerce是一款免费给WooCommerce添加订单状态的插件,可以从WordPress后台免费安装。
插件地址
使用这款插件,还可以为自定义状态添加图标和颜色。

使用代码添加自定义订单状态
使用代码添加的话可以少安装一个插件,不过小白乱改代码可能会导致网站出现错误,所以使用此方法请谨慎。
Code复制代码function naiba_wc_register_post_statuses() {
register_post_status( 'wc-shipping-progress', array(
'label' => _x( 'Shipping In Progress', 'WooCommerce Order status', 'text_domain' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Approved (%s)', 'Approved (%s)', 'text_domain' )
) );
}
add_filter( 'init', 'naiba_wc_register_post_statuses' );
function naiba_wc_add_order_statuses( $order_statuses ) {
$order_statuses['wc-shipping-progress'] = _x( 'Shipping In Progress', 'WooCommerce Order status', 'text_domain' );
return $order_statuses;
}
add_filter( 'wc_order_statuses', 'naiba_wc_add_order_statuses' );添加上面代码到你主题函数文件里面,保存之后就可以在订单列表状态中看到Shipping In Progress的选项。
相关推荐
- 免插件导出WooCommerce订单教程
- 允许在WooCommerce的分类描述里面插入html代码和图片
- 怎么修改WooCommerce的产品排序
- 怎么删除WooCommerce产品价格显示
- Peki - Fiken Integration for WooCommerce 最好的WordPress通用插件下载 博客插件模块
- Tara360 Gateway 最好的WordPress通用插件下载 博客插件模块
- Vessi.cl电子邮件最好的WordPress常用插件下载 博客插件模块
- Real Time Shipping Quotes for WooCommerce 最好的WordPress通用插件下载 博客插件模块
- Increment Buttons for Woo 最好的WordPress常用插件下载 博客插件模块
- PushLock Multi-site Products Lock for WooCommerce 最好的WordPress通用插件下载 博客插件模块
- WordPress教程排行
- 最近发表
-
- XBOX360官方英日文游戏精选集
- XBOX360 KINECT体感游戏合集
- 教育类WordPress主题 Eduma安装和简单使用教程
- 网易企业邮箱购买和使用教程/SMTP/POP/客户端配置等
- 工业建筑行业WordPress主题Batiment安装和简单使用教程
- Elementor报错提示“Uncaught SyntaxError: Identifier ‘a’ has already been declared (at instant-page.min.js”
- 免插件导出WooCommerce订单教程
- 允许在WooCommerce的分类描述里面插入html代码和图片
- 为什么SEO插件都没有设置keywords选项了?
- 适合新手使用的WordPress企业主题:启航


