I've searched everywhere for a solution to this but can't seem to find something that matches my exact scenario.
Here's my scenario;
When an order from a "specific category" named "Typing Service" is placed, I want it randomly assigned to a staff (store manager) with a custom role named "Typist"
The typist (store manager) is able to handle and update the order status. Typist can only see and handle orders that has been assigned to him.
The site admin should have an option on the orders page to reassign the order to a different Typist in an event where the previously randomly assigned typist is not available to handle the order.
I was able to find a code that does part 2. of my problem on this link.
But I can't figure out how he implemented part 1. which is critical for part 2. to work. I would really appreciate any help, preferably a code I can add via code snippets plugin or to functions.php
.
I'm using How can I assign an order to a certain shop manager in Woocommerce
But how do I make it assign the order randomly instead to any store manager with a custom role "Typist"