Magento产品详细信息图像尺寸

6

Magento 1.4

默认产品详细信息图片大小为265x265。

我们所有的产品图片可能会比宽度高出2倍,即使我们将它们填充成正方形,265对于查看图像细节来说仍然太小了,因此我们希望将图像变得更高。

我找到了media.phtml文件。

我们该如何修改这个文件/ Magento,以便产品详情页面的图片为265W x 530H。

这似乎是显示图像的代码。

<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>
2个回答

5

只需将高度参数传递到resize函数中:

<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>

希望这能帮到您! 谢谢, 乔

2

使用 auto(或完全删除数字),然后使用CSS传递宽度,高度将随之设置。

CSS在 boxes.css 中,如果您是在空白主题上,则全部在 styles.css 中。

.product-view .product-img-box .product-image img {
  width: 560px
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接