没有缓存的Magento 1.9图像URL

时间:2014-06-16 20:56:05

标签: php image magento url

我是Magento的新手,我无法找到明确的答案。在浏览器中,我的网站图片显示如下:

www.example.com/shop/media/catalog/product/cache/1/image/820x/040ec09b1e35df139433887a97daa66f/i/m/image-name.jpg

我希望我的图片显示如下:

www.example.com/shop/media/catalog/product/i/m/image-name.jpg

我没有调整图像大小或使用水印。

在media.phtml(app / design / frontend / mytheme / default / template / catalog / product / view / media.phtml)上,我有这段代码:

<div class="img-holder<?php if($labelsoptions['labelsorder'] == 'sale_new'):?> labels-sale-new<?php endif; ?>">
    <?php if(($fancy['fancybox_status']==1) and ($fancy['fancybox_product']==1)): ?>
    <a href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" class="fancybox"><i class="fa fa-search"></i></a>
    <?php endif; ?>
    <a id='zoom' class="cloud-zoom" data-zoom="showTitle: false, adjustX: -5, adjustY:-5, tint: '#fff', tintOpacity:0.6, position:'inside'" href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>"><?php
        $_img = '<img id="image" src="' . $helpImg->getImg($_product, 'image', $imgSize, null) .'"" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
        echo $_helper->productAttribute($_product, $_img, 'image');
    ?></a>
    <?php echo MAGE::helper('MyThemeOptions')->getProductLabels($_product, 'new'); ?>
    <?php echo MAGE::helper('MyThemeOptions')->getProductLabels($_product, 'sale'); ?>
</div>

我取而代之:

<a href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>"

我在谷歌找到了这个代码,但没有任何反应:

<a href="<?php echo Mage::getSingleton('catalog/product_media_config')->getBaseMediaUrl().$this->getProduct()->getImage(); ?>"

感谢您的帮助。感谢。

1 个答案:

答案 0 :(得分:1)

以下是获取完整尺寸产品图片的方法:

$fullImgUrl = Mage::getUrl('media') . 'catalog/product' . $_product->getImage();
不过,您可以使用浏览器检查功能来了解输出内容