Я пытался добавить статус пользовательского заказа Отправлено в woocommerce.
вот код
function add_awaiting_shippped_to_order_statuses( $order_statuses ) {
$new_order_statuses = array();
// add new order status before processing
foreach ($order_statuses as $key => $status) {
$new_order_statuses[$key] = $status;
if ('wc-processing' === $key) {
$new_order_statuses['wc-order-shipped'] = __('Shipped', 'woocommerce' );
}
}
return $new_order_statuses;
}
function register_shipped_status() {
register_post_status( 'wc-order-shipped', array(
'label' => _x( 'Shipped', 'Order status', 'woocommerce' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Shipped <span class="count">(%s)</span>', 'Shipped<span class="count">(%s)</span>', 'woocommerce' )
) );
}
add_action( 'init', array( $plugin_admin_meta_box, 'register_shipped_status') );
add_filter( 'wc_order_statuses', array( $plugin_admin_meta_box, 'add_awaiting_shippped_to_order_statuses') );
Статус доставки отображается везде в woocommerce, и он отлично работает
Всякий раз, когда я меняю статус заказа на отправку, он успешно обновляется
Теперь проблема в том, что отправленные заказы не отображаются в таблице заказов
![enter image description here](https://i.stack.imgur.com/hHVGR.png)