title: Magento - How to filter a product collection using 2 category filters?
body: <p>Does anyone know if there is a way to run a product collection through a category filter twice? I have a ‘featured’ category, which is hidden, that I add products to so they’re available to grab as featured products. Currently I'm getting my product collection like this:</p>
  
  <pre><code>$_productCollection = Mage::getResourceModel('reports/product_collection')
      -&gt;addAttributeToSelect('*')
      -&gt;addAttributeToFilter('visibility', $visibility)
      -&gt;addCategoryFilter('36');
      $_productCollection-&gt;load();
  </code></pre>
  
  <p>This works fine on the homepage, but on the category pages, I need to filter the results by the current category first, and then by the featured category:</p>
  
  <pre><code>$_productCollection = Mage::getResourceModel('reports/product_collection')
      -&gt;addAttributeToSelect('*')
      -&gt;addAttributeToFilter('visibility', $visibility)
      -&gt;addCategoryFilter('15')
      -&gt;addCategoryFilter('36');
      $_productCollection-&gt;load(); 
  </code></pre>
  
  <p>Unfortunately, it seems you can’t perform 2 category filters without editing core files, which I don’t want to do.</p>
  
  <p>Any ideas how to get around this?</p>
  
  <p>I was thinking I could maybe grab 2 product collections separately, one filtered by current category, and one by featured category, then using PHP's <em>stristr</em> find the products residing in both and use those, like</p>
  
  <pre><code>  if (stristr($featProductCollection, $currProductCollection))
  </code></pre>
  
  <p>Anyone any ideas? I think I’d need to return maybe just the SKU’s of the products, maybe in a comma separated list. But I’m not sure of the best way to go about this, and it does seem a bit hacky. </p>