Jake Vanderwerf
2026-09-16 a239ef33ec489ce6d0f25ac2f256df0ac54a7e50
inc/integrations/SyncToUser.php
@@ -36,6 +36,12 @@
   }
   protected function handleUpdateUser(int $userID):void
   {
      if (!$this->isSetUp()) {
         return;
      }
      if (isset(self::$syncing['users'][$userID])) {
         return;
      }
      $user = $this->getOrCreateUser($userID);
      if (!$user) {
         return;
@@ -45,10 +51,12 @@
      if (!empty($fields["_{$this->service_name}_item_id"])) {
         return;
      }
      self::$syncing['users'][$userID] = true;
      $this->removeSaveUser();
      $this->handleTheSaveUser($userID);
      $this->addSaveUser();
      unset(self::$syncing['users'][$userID]);
   }
   protected function getOrCreateUser(int $userID):string|false
@@ -137,6 +145,9 @@
    */
   protected function handleTheSaveUser(int $userID):void
   {
      if (!$this->isSetUp()) {
         return;
      }
      error_log('==== ['.$this->title.']::handleTheSaveUser ====');
      //TODO: This is likely only for stuff like customers.
      //If we have multiple stores connected, we may have to queue operations to update every connection's customer account if they made an order with that store