Magento collection pagination

$pager = 1;
if (isset($_GET['page'])) {
$pager = $_GET['page'];
}
$collection = Mage::getModel(‘customer/customer’)
->getCollection()
->setPageSize(9)
->setCurPage($pager)
->addAttributeToSelect(‘*’);
/*->addFieldToFilter(‘group_id’, 4);*/

$count = Mage::getModel(‘customer/customer’)->getCollection()->getSize();
$page_num = ceil($count / 9);

 

’ . $i . ‘ ‘; } ?>

Posted

in

by

Tags: