I do have following code below for a Grid in Admin
protected function _prepareCollection()
{
$pimage_collection = new Varien_Data_Collection();
$pimage_array = array();
$product_collection = Mage::getModel('catalog/product')->getCollection();
foreach($product_collection as $product) {
$prod = Mage::getModel('catalog/product')->load($product->getId());
foreach ($prod->getMediaGalleryImages() as $image) {
$pimage_object = new Varien_Object();
$pimage_object->setData('id',$prod->getData('entity_id').'-'.$image->getData('id'));
$pimage_object->setData('product_name',$prod->getData('name'));
$pimage_object->setData('image_path',$image->getData('file'));
$pimage_object->setData('label',$image->getData('label'));
$pimage_array[] = $pimage_object->getData('id');
$pimage_collection->addItem($pimage_object);
}
}
$this->setCollection($pimage_collection);
return parent::_prepareCollection();
}
Now what I want there is to create a grid showing all the images of all products in my catalog.
It seems to work fine as it show all the images already and all the products.
But it breaks the pagination. How can i fix this?