magento

Collections

Product Collection

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

Selecting the specific Attribute

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

Selecting the All Attributes

$productCollection->addAttributeToSelect('*');

Add Filter on Collection

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

Set Order

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

Set limit

$productCollection->setPageSize(10);

Set Current Page

$productCollection->setCurPage($page);

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow