I use this code for new order and set complete status.
After it, woocommerce send automatic email to buyer.
But I want dont send this email.
How I can?
$order = wc_create_order();
$order->set_customer_id($userId);
foreach($_POST['basket'] as $prod){
$order->add_product(get_product($prod['id']), $prod['count']);
}
$order->set_address($address, 'billing');
$order->calculate_totals();
$order->update_status("completed", 'TEST', TRUE);
Note: I dont want disable send email from wp-admin