Magento 1.4
Default Product Details image size is 265x265.
All of our product images will be probably 2x taller than wide, and even if we pad them to make them square 265 will be too small to see detail in the image, so we'd like to make the image taller.
I found the media.phtml file
How would we go about modifying this file/Magento so that the product details page image is 265W x 530H.
This looks like the code that displays the 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>
Simply pass the height parameter into the resize function as well:
<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 that helps!
Thanks, Joe
Use auto
(or remove the number entirely) and then pass the width with the CSS and the height will set accordingly.
The css is in boxes.css
or if you are on blank theme its all in styles.css
.product-view .product-img-box .product-image img {
width: 560px
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With