0

How to Rename “wc-checkout-draft” Order Status lable? bellow code work for other statuses but not work for wc-checkout-draft

    add_filter( 'wc_order_statuses', 'renamedraft' );
function renamedraft( $statuses ) {
   $statuses['wc-checkout-draft'] = 'newlable';
   return $statuses;
}
add_filter( 'woocommerce_register_shop_order_post_statuses', 'regrenamedraft' ); 
function regrenamedraft( $statuses ) {
   $statuses['wc-checkout-draft']['label_count'] = _n_noop( 'newlable<span class="count">(%s)</span>', 'newlable<span class="count">(%s)</span>', 'woocommerce' );
   return $statuses;
}

also as you see the is not in the list of WC statues list, but i can see in the edit order page

function wc_get_order_statuses() { 
$order_statuses = array( 
    'wc-pending' => _x( 'Pending payment', 'Order status', woocommerce ),  
    'wc-processing' => _x( 'Processing', 'Order status', woocommerce ),  
    'wc-on-hold' => _x( 'On hold', 'Order status', woocommerce ),  
    'wc-completed' => _x( 'Completed', 'Order status', woocommerce ),  
    'wc-cancelled' => _x( 'Cancelled', 'Order status', woocommerce ),  
    'wc-refunded' => _x( 'Refunded', 'Order status', woocommerce ),  
    'wc-failed' => _x( 'Failed', 'Order status', woocommerce ),  


); 
return apply_filters( 'wc_order_statuses', $order_statuses ); 
Behzad
  • 75
  • 1
  • 7
  • Check this: https://stackoverflow.com/questions/37790855/renaming-woocommerce-order-status hope this helps you!! – Full Stop Mar 13 '23 at 12:21
  • i just test below code from your pointed location, but not work for wc-checkout-draft – Behzad Mar 13 '23 at 12:55

0 Answers0