在一个BLOCK的类里面
require_once 'Mage/Catalog/Block/Product/List.php';
class Sola_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
{
public function _prepareLayout()
{
$params = $this->getRequest()->getParams();
$id = $this->getRequest()->getParam('id');
$collection = Mage::getSingleton('catalog/layer')
->getProductCollection();
$pager_num = Mage::getStoreConfig('catalog/frontend/grid_per_page');
$pager = $this->getLayout()->createBlock('page/html_pager')
->setUseContainer(false)
->setShowAmounts(false)
->setShowPerPage(false)
->setLimit($pager_num)
->setCollection($collection);
$this->setChild('pager', $pager);
}
public function getPagerHtml()
{
return $this->getChildHtml('pager');
}
}
对应的.phtml
<?php echo $this->getPagerHtml();?>
使用magento的分页
2013年1月22日星期二 Asia/Shanghai下午5:49:16
Posted By