小编Adh*_*esh的帖子

Magento定制系列打破了分页

我通过向Varien_Data_Collection集合对象添加项目来创建集合.

$collection = new Varien_Data_Collection();
  foreach($array_of_products as $productId){
    $collection->addItem(Mage::getModel('catalog/product')->load($productId));
}
Run Code Online (Sandbox Code Playgroud)

但是,当此对象传递给Magento寻呼机块时,如下所示,它会破坏我的自定义页面中的分页.

$pager = $this->getLayout()->createBlock('page/html_pager', 'retailerfe.analysis.pager')
            ->setCollection($collection);
Run Code Online (Sandbox Code Playgroud)

PS从Mage :: getModel('module/modelname') - > getCollection()等模型集合中获取的集合从未出现过问题.它只是通过向Varien_Data_Collection对象添加项而创建的集合.

collections pagination magento

6
推荐指数
1
解决办法
5662
查看次数

标签 统计

collections ×1

magento ×1

pagination ×1