How to load products which is not in particular category in magento
I have to load all available products from the part开发者_Go百科icular attribute-set value additionally it needs to filter only the products which are not under particular category/categories. How can i load product collection here. Please help me
<?php
$storeId = Mage::app()->getStore()->getId();
$catalog = $this->getLayout()->createBlock('catalog/product_list')->setStoreId($storeId);
$collection = $catalog->getProductCollection()->addAttributeToSelect('*');
$collection->getSelect()->where(category_id != { cat_id } )->limit($this->products_count);
$_productCollection = $collection;
?>
This isn't teste yet and I'm not sure if category_id is the correct value that is used in the database. But it should give you a good start.
精彩评论