title: Php Magento list all configurable products out with simple products out of stock
body: <p>We have made an xml file for our products and we have a problem.</p>
  
  <p>In our Magento shop all configurable products stay in stock also if simple products have a qty of 0. We need this function for our administration / stock system. We have a filter set that filters out all products that are not in stock (see below). Now we also need a filter for configurable products that are in stock, but the simple products are out of stock and have a qty of 0. </p>
  
  <p>Filter to not show out of stock products</p>
  
  <pre><code>-&gt;joinField('is_in_stock',
                  'cataloginventory/stock_item',
                  'is_in_stock',
                  'product_id=entity_id',
                  'is_in_stock=1',
                  '{{table}}.stock_id=1',
                  'left');
  
          $products-&gt;addAttributeToFilter('is_in_stock', array('eq' =&gt; 1));
  </code></pre>
  
  <p>So example:</p>
  
  <pre><code>Configurable product: is in stock
  Simple 1, simple 2, simple 3: are out of stock
  </code></pre>
  
  <p>We need to filter out the configurable product with all simple products with status out of stock or qty0</p>
  
  <p>It would be great if someone has the answer because we just do not see the solution.</p>