1

Right now when I upload an image into a Magento product at 920 x 1380 and I go to the Product display page it displays the image at 500 x 750 it scales down the image in proportion

The end Image size I want on the Product display page is 390 x 585 this is also in proportion to the 920 x 1380

How can I do this?

If found that i needed to edit the media.phtml file but when I do that the image size is to small to trigger the zoom feature. So now how do I get the image size on the product page to be 390 x 585 and have the zoom feature? The Image size I am loading into magento is big enought for the zoom feature. The image is 920 x 1380

1

Please check code which is below for Product image resizeing.

echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(390, 585);
| improve this answer | |
  • is this in the media.phtml app/design/frontend/rwd/default/template/catalog/product/view I added this in that code file code<img id="image-main" class="gallery-image visible" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->constrainOnly(true)->resize(390, 585); ?>code – life1134 Aug 9 '18 at 19:31
  • Yup if you need to resize the image in product view page then you need add the code in media.phtml – Learing_Coder Aug 9 '18 at 19:35
  • I did that but when I did that the zoom feature no longer worked. – life1134 Aug 9 '18 at 19:38
  • what you mean by zoom feature? – Learing_Coder Aug 9 '18 at 19:38
  • if you mouse over the image you will see it zooms in on a section magento.digitalmarauders.com/index.php/jewlery/banana.html – life1134 Aug 9 '18 at 19:42
0

Use this code for product images in list.phtml file(app/design/frontend/[current package]/[current theme]/template/catalog/product/list.phtml)

Code:

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($width, $height); ?>

| improve this answer | |

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.