2

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;

  1. 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"

  2. 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.

  3. 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"

7uc1f3r
  • 28,449
  • 17
  • 32
  • 50
  • Although following answer is not complete what you are looking for: [How to automatically create an account if a product in the order belongs to a certain category in WooCommerce](https://stackoverflow.com/a/64042179/11987538), it does contain the steps to check an order for a certain category. – 7uc1f3r Oct 28 '20 at 11:01
  • However, be aware that seeking recommendations are [off-topic](https://stackoverflow.com/help/on-topic) on Stack Overflow — we expect questions here to relate to specific programming problems. Your question also lacks some focus and now appears to contain multiple questions in one while this is not the case. So it is better to focus only on the first step in your question and show what you have [tried so far](https://meta.stackoverflow.com/questions/260648/stack-overflow-question-checklist) – 7uc1f3r Oct 28 '20 at 11:01
  • Yeah, the first step is actually the most critical, others are just explanation of the final scenario i wish to accomplish and are secondary. I see @loictheaztec has helped with something similar in the past, was hoping he could chip in – Muazu Momoh Oct 28 '20 at 23:38
  • As I already mentioned, the intention is to get started yourself, to show where you get stuck and then someone can help you further. Where is your [code attempt](https://meta.stackoverflow.com/questions/260648/stack-overflow-question-checklist)? The link I referred to can already help you answer (a part) from your own question. – 7uc1f3r Oct 29 '20 at 07:47
  • Thanks. But maybe my question wasn't clear enough, as the link you referred to is to create an account and assign it for guest orders. In my scenario the customer already has an account, and I want to randomly assign it to a store manager for handling. I've updated my question to make it clearer and also added a sample code thats does this, but assigns orders to a store manager based on region – Muazu Momoh Oct 29 '20 at 08:47
  • I know that the answer I referred to does not answer your question. However, it does contain pieces of code that are identically the same as in the answer to question. It was therefore my intention that you would work with the code to which I referred to arrive at an answer to your own question. Now you just pasted a piece of random code into your question without making any adjustments yourself. This is not how stack overflow works, you can read how it works in my previous comments – 7uc1f3r Oct 29 '20 at 11:08

0 Answers0