In WooCommerce, I have made 2 custom order statuses. The first one is 'shipping status' and the other one is 'approved status'.
After I have changed some orders status to these two new statuses (which are shipping
or approved
), the customer can't view this orders on his order history page.
Here is my code:
function register_awaiting_shipment_order_status() {
if('product_manager' == $get_roles || 'administrator' == $get_roles){
register_post_status( 'wc-shipping', array(
'label' => 'wc-shipping',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Shipping <span class="count">(%s)</span>', 'Shipping <span class="count">(%s)</span>' )
) );
}
if('approver' == $get_roles || 'administrator' == $get_roles ||'product_manager' == $get_roles ){
register_post_status( 'wc-approved', array(
'label' => 'wc-approved',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Approved <span class="count">(%s)</span>', 'Approved <span class="count">(%s)</span>' )
) );
}
}
add_action( 'init', 'register_awaiting_shipment_order_status' );
But if I change the order status back to the Woocommerce's
default order statuses (for example "completed"), then the customer can view them i his order history again.
What I am doing wrong?
How can I display new orders with that new custom statuses on customer order history page?
Thanks.