I have added a custom order status using this code in functions.php
// Register new order status
function register_produktionsklar_order_status() {
register_post_status( 'wc-produktionsklar', array(
'label' => 'Klar til produktion',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Klar til produktion (%s)', 'Klar til produktion (%s)' )
) );
}
add_action( 'init', 'register_produktionsklar_order_status' );
// Add new order status to list of WC Order statuses
function add_produktionsklar_to_order_statuses( $order_statuses ) {
$new_order_statuses = array();
// add new order status after processing
foreach ( $order_statuses as $key => $status ) {
$new_order_statuses[ $key ] = $status;
if ( 'wc-afventer-godkend' === $key ) {
$new_order_statuses['wc-produktionsklar'] = 'Klar til produktion';
}
}
return $new_order_statuses;
}
add_filter( 'wc_order_statuses', 'add_produktionsklar_to_order_statuses' );
I would like to include this custom order status in the order count. When I change the status to this custom status, the order is no longer counted in the open orders number. (see attached image for clarity)
Any help would be great
