Change Product Image Size on Magento Category Grid/List Pages

If you are using the default phtml files for Magento, the image sizes for the products are the following:

Thumbnail: 50x50px
Small image: 135x135px
Base image: 265x265px

And this what shows on the category pages. But if you are looking to have your own custom size for those category products listing page, then here is how to do it.

1. Open up your list.phtml file and edit this as per your size requirements :

1
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(400,136) ?>" data-srcX2="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(400,136) ?>" width="400" height="136" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

2. You will need to modify your css as well.

Gửi phản hồi

Please log in using one of these methods to post your comment:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s

%d bloggers like this: