$order_data = array(
187: 'status' => apply_filters( 'woocommerce_default_order_status', 'pending' ),
188: 'customer_id' => $this->customer_id,
189: 'customer_note' => isset( $this->posted['order_comments'] ) ? $this->posted['order_comments'] : ''
190: );
woocommerce_default_order_status
, который принимает 1 аргумент - собственно статус (string). Можете попробовать в него вписать свой:add_filter( 'woocommerce_default_order_status', 'custom_complete_status' );
function custom_complete_status() {
return 'completed';
}
do_action( 'woocommerce_new_order', $order_id );
if (!function_exists('write_log')) {
function write_log ( $log ) {
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
}