Collections

Other topics

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);

Contributors

Topic Id: 7206

Example Ids: 24061

This site is not affiliated with any of the contributors.