Magento Product Details Image Size

Magento 1.4

The default image size is 265x265.

All the images of our products will probably be 2x higher than the widths, and even if we put them to make them square, 265 will be too small to see the details in the image, so we would like to make the image taller.

I found media.phtml file

How will we modify this file / Magento so that the product detail page image is 265W x 530H.

It looks like code displaying an image.

<p class="product-image"> <?php $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />'; echo $_helper->productAttribute($_product, $_img, 'image'); ?> </p> 
+6
php magento
source share
2 answers

Just pass the height parameter to the resize function:

 <p class="product-image"> <?php $_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265, 530).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />'; echo $_helper->productAttribute($_product, $_img, 'image'); ?> </p> 

Hope this helps!

Thanks Joe

+5
source share

Use auto (or completely remove the number) and then pass the width using CSS and set the height accordingly. Css is in boxes.css , or if you are in an empty topic, everything is in styles.css

 .product-view .product-img-box .product-image img { width: 560px } 
+2
source share

All Articles