Frage

I’m writing a little script to hopefully pull a collection of products which match certain criteria - so far its working at its most basic using:

$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToFilter('status', 1);
$products->addAttributeToSelect('*');

What I am struggling with is creating a filter which will only pull products into the collection if they are not assigned to any categories.

I have been tearing my hair out searching through any docs I can find but cant seem to get my head around it - I can use getAvailableInCategories() after but looping through 25,000 products is time consuming and there must be a better way to do it.

Any help appreciated - im a complete newbie smile

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange
scroll top