title: Auto assign a shop manager to a new WooCommerce order based on variable increment
body: <p>I'm trying to assign every new order to a list of shop managers. What I need is like a queue, so every time a new order is created assign to the next shop manager in the queue.</p>
  <p>This is the code I have:</p>
  <pre class="lang-php prettyprint-override"><code>function before_checkout_create_order($order, $data) {
      global $i;
      switch ($i) {
          case 0:
              $user = get_user_by('email', 'firstShopManagere@example.com');
              break;
          case 1:
              $user = get_user_by('email', 'secondShopManager@example.com');
              $i=0;
              break;
      }
      $userLastName = $user-&gt;user_lastname;
      $order-&gt;update_meta_data('asesor_asignado',$userLastName);  
      $i++;
  }
  add_action('woocommerce_checkout_create_order', 'before_checkout_create_order', 20, 2);
  </code></pre>
  <p>The problem I'm dealing with now is that the <code>$i</code> variable can't be stored even though I increment the value that doesn't change so that the next time the value is <strong>0</strong> again. Also every time <code>$i</code> reaches <strong>4</strong>, it should go back to <strong>0</strong></p>
  <p>Any advice?</p>