Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created April 17, 2014 02:32
Show Gist options
  • Select an option

  • Save ryaan-anthony/10948986 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/10948986 to your computer and use it in GitHub Desktop.
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left');
$collection->addAttributeToFilter('category_id', array('null' => true));
$collection->addAttributeToFilter('status', 1);
$collection->addAttributeToSelect('*');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment