Untitled

 avatar
unknown
plain_text
a year ago
1.1 kB
3
Indexable
add_filter( 'woocommerce_register_shop_order_post_statuses', 'b2bking_register_custom_order_status' );
 
function b2bking_register_custom_order_status( $order_statuses ) {
   $order_statuses['wc-pending-shipping'] = array(
      'label' => 'Pending Shipping Quote',
      'public' => false,
      'exclude_from_search' => false,
      'show_in_admin_all_list' => true,
      'show_in_admin_status_list' => true,
      'label_count' => _n_noop( 'Pending Shipping Quote <span class="count">(%s)</span>', 'Pending Shipping Quote <span class="count">(%s)</span>', 'woocommerce' ),
    );
   return $order_statuses;
}
 
add_filter( 'wc_order_statuses', 'b2bking_show_custom_order_status_single_order_dropdown' );
 
function b2bking_show_custom_order_status_single_order_dropdown( $order_statuses ) {

    $i = 2;
    $order_statuses = array_slice($order_statuses, 0, $i, true) +
        array('wc-pending-shipping' => 'Pending Shipping Quote') + 
        array_slice($order_statuses, $i, count($order_statuses)-$i, true);

    $i++;

   return $order_statuses;
}
Editor is loading...
Leave a Comment