1

我正在使用 Magento 扩展来控制我的色板。此模块还控制目录列表缩略图。我有使用调整大小的经验,但目前似乎不起作用。

在开发人员模式下,我启用了模板路径提示,它告诉我它位于 frontend/.../default/template/catalog/product/list.phtml (典型目录)

问题:单击之前,图像默认大小正确。但是当我单击缩略图时,它们会调整为 135x135(倾斜和较低的分辨率)。

我在 list.phtml 中的产品网格:

    <ul class="products-grid">
    <?php endif ?>
        <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img id="<?php echo $_product->getId();?>" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(146,196); ?>" width="146" height="196" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
            <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
            <?php echo $this->getLayout()->createBlock("colorselectorplus/listswatch")->setTemplate("colorselectorplus/listswatches.phtml")->setData('product', $_product)->toHtml(); ?>
            <?php if($_product->getRatingSummary()): ?>
            <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
            <?php endif; ?>
            <?php echo $this->getPriceHtml($_product, true) ?>

        </li>
    <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
    </ul>

如果我是正确的,这应该由

    resize(146,196)

是否有可能 onclick 图像由不同的 phtml 加载?

谢谢!如果您需要网址,请告诉我。(我们还没上线) 在此处输入图像描述
在此处输入图像描述

我已经联系了作者,并阅读了常见问题解答。我还没有听到回应。

4

2 回答 2

3

我遇到了同样的问题并联系了 Amasty 支持。这是他们发给我的解决方案,因为上述解决方案不是解决方案。

我们的颜色样本在此文件中调整图像大小(第 78-85 行):app\code\local\Amasty\Conf\Block\Catalog\Product\View\Type\Configurable.php

$parentProduct = Mage::getModel('catalog/product')->load($simple->getParentId());
if($parentProduct){
    $confData[$strKey]['parent_image'] =(string)($this->helper('catalog/image')->init($parentProduct, 'small_image')->resize(135));
    if(!('no_selection' == $simple->getSmallImage() || '' == $simple->getSmallImage())){
        $confData[$strKey]['small_image'] = (string)($this->helper('catalog/image')->init($simple, 'small_image')->resize(135));
    }
    else{
        $confData[$strKey]['small_image'] = (string)($this->helper('catalog/image')->init($parentProduct, 'small_image')->resize(135));
    }
} 
于 2013-06-06T16:59:48.477 回答
0

此修复程序位于与我们已安装的模块相关的本地文件中。就像编辑调整宽度/高度一样简单,但不存储在用户友好的区域中。

于 2012-01-12T23:42:41.637 回答