WooCommerce 怎么添加订单状态呀
wordpress吧
全部回复
仅看楼主
level 5
1124011648 楼主
WooCommerce 怎么添加订单状态呀
2019年01月03日 09点01分 1
level 5
1124011648 楼主
求教,求教[呵呵]
2019年01月04日 01点01分 2
level 1
function register_already_shipped_order_status() {
register_post_status( 'wc-weighing', array(
'label' => '正在称重',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Weighing <span class="count">(%s)</span>', '正在称重 <span class="count">(%s)</span>' )
) );
}
function add_already_shipped_to_order_statuses( $order_statuses ) {
$new_order_statuses = array();
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-processing' === $key ) {
$new_order_statuses['wc-weighing'] = '正在称重';
}
}
return $new_order_statuses;
}
add_action( 'init', 'register_already_shipped_order_status' );
add_filter( 'wc_order_statuses', 'add_already_shipped_to_order_statuses' );
2019年03月22日 07点03分 3
level 12
这种大型的官方插件,如果想二次开发或者加功能,建议你直接去官方看文档而不是在贴吧问,一般官方搜索关键字都可以找到答案。
2019年03月27日 07点03分 4
1