For some reason, I'm splitting my order in two part (the first is handle by some organization and the other will me handle by the magento owner).
I'm creating programmatically the order, and for one of the part, I need to stop the mail of the order to be sended.
Example : In quote : watch, Tv, video game. Splitting in two parts :
- watch, tv
- video games
Send email for the watch and tvs Not send mail for video game.
How can I do this ?
EDIT : i'm splitting my code by doing a foreach on the quote item. If the item is in a category, I create a array with those items.
Then I'm creating my order like this : https://www.rakeshjesadiya.com/how-to-create-order-programmatically-in-magento-2/
And i'm calling the method twice, one for the first part, the other for the second.
I've notice that the email is not sended for the second part if I have placed those 2 orders parts. That's ok I guess, but if the first part is not placed, the second part will send a mail.