magento Collections Product Collection


Example

$ProductCollection=Mage::getModel('catalog/product')->getCollection();

Selecting the specific Attribute

$ProductCollection->addAttributeToSelect(array('name', 'product_url', 'small_image'));

Selecting the All Attribute

$ProductCollection->addAttributeToSelect('*');

Add Filter on Collection

$ProductCollection->addFieldToFilter('is_active',1);

Add Product Attribute Filter on Collection

$ProductCollection->addAttributeToFilter('weight', array('gt' => 100));

Set Order

$ProductCollection->setOrder('id','ASC');

Set limit

$ProductCollection->setPageSize(10);

Set Current Page

$ProductCollection->setCurPage(1);