Reputation: 53
I am using Magento 1.9.0.1.
When I go on a Category to view the products, All products are shown in square boxes. As my images are rectangle, I can see the white space on left and right sides of the images.
Please advise how to edit the code so that images are shown rectangle shape (hight:300px width:200px).
Thanks
Upvotes: 1
Views: 9673
Reputation: 1062
Use this code for product images in list.phtml file(app/design/frontend/[current package]/[current theme]/template/catalog/product/list.phtml
)
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($width, $height); ?>
Hope this helps! Thanks.
Upvotes: 3
Reputation: 17656
Take a look @
/app/design/frontend/default/{theme}/template/catalog/product/list.phtml
Change resize(width, height)
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(158, 150); ?>
Upvotes: 4