1

How can I show products images on category products page?

enter image description here

1

Please refer to this link: http://inchoo.net/magento/show-product-thumbnail-in-grids/

There is one small change you will require to a file in above module or it may give you Image file was not found error.

Open app\code\local\Inchoo\Thumbnail\Block\Adminhtml\Template\Grid\Renderer\Image.php file and update render function with below code.

public function render(Varien_Object $row)
{
    try{
      $val = Mage::helper('catalog/image')->init($row, 'thumbnail')->resize(97);
    }
    catch(Exception $e) {
      $val = Mage::getDesign()->getSkinUrl('images/catalog/product/placeholder/image.jpg',array('_area'=>'frontend'));  
    }
    $out = "<img src=". $val ." width='97px'/>";
    return $out;
}

Images will be displayed as per below screenshot. enter image description here

To add edit link on grid, updated below file. app\code\local\Inchoo\Thumbnail\Block\Adminhtml\Catalog\Category\Tab\Product.php

Add below code just before return parent::_prepareColumns();

$this->addColumn('action',
    array(
        'header'    => Mage::helper('catalog')->__('Action'),
        'width'     => '50px',
        'type'      => 'action',
        'getter'     => 'getId',
        'actions'   => array(
            array(
                'caption' => Mage::helper('catalog')->__('Edit'),
                'url'     => array(
                    'base'=>'adminhtml/catalog_product/edit',
                    'params'=>array('store'=>$this->getRequest()->getParam('store'))
                ),
                'field'   => 'id'
            )
        ),
        'filter'    => false,
        'sortable'  => false,
        'index'     => 'stores',
));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.