Body: <p>I have the following</p>
  
  <pre><code>$criteria = craft()-&gt;elements-&gt;getCriteria('Commerce_Product');
  $criteria-&gt;search = 'unquieId:' . $result['id'];
  $criteria-&gt;status = null;
  $product = $criteria-&gt;find();
  </code></pre>
  
  <p>The unique result returns a product if it's there and ideally empty if it's not. The odd behavior I'm seeing is if the product is marked disabled in Craft Commerce then the product is returned empty. I thought the status null may help but I don't think they equate. Any thoughts?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-05T20:30:43.433Z
Comments.Text: I'm not able to reproduce this. If a product is disabled, then using `$criteria->status = null;` will find it and removing that line won't find it.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-21T15:30:08.123Z
Comments.Text: This also works for me. Can you check the value of `$result['id']` and then check to see whether manually adding the results id works? So something like `$criteria->search = 'unquieId:12';`
Comments.UserDisplayName: Luke Pearce
Tags: <plugin-development><plugin-craftcommerce>
Title: Commerce - Get Model via Custom Field
ThreadText: # Commerce - Get Model via Custom Field
  
  (Asked by: username_0 on 2016-05-05)
  
  I have the following
  
  ```
  $criteria = craft()->elements->getCriteria('Commerce_Product');
  $criteria->search = 'unquieId:' . $result['id'];
  $criteria->status = null;
  $product = $criteria->find();
  
  ```
  
  The unique result returns a product if it's there and ideally empty if it's not. The odd behavior I'm seeing is if the product is marked disabled in Craft Commerce then the product is returned empty. I thought the status null may help but I don't think they equate. Any thoughts?
  
  **Tags:** plugin-development, plugin-craftcommerce
  
  > **Comments:**
  > **username_1**: I'm not able to reproduce this. If a product is disabled, then using `$criteria->status = null;` will find it and removing that line won't find it.  
  > **username_2**: This also works for me. Can you check the value of `$result['id']` and then check to see whether manually adding the results id works? So something like `$criteria->search = 'unquieId:12';`  
  
  ---
  
  ## 0 answers
  
  