In a multistore setup, I need to find products that are assigned to website A and website B.
The product collection has a addWebsiteFilter()
method but unfortunately it doesn't serve this purpose, as can be seen in Mage_Catalog_Model_Resource_Product_Collection::_productLimitationJoinWebsite()
, where the filter gets applied:
$conditions[] = $this->getConnection()
->quoteInto('product_website.website_id IN(?)', $filters['website_ids']);
The query will match for all products that are assigned to any of the given websites. What is the best way to build a query for products that are present in multiple websites?