如何在magento中删除产品图像的缓存URL [英] How to remove the cache url for product images in magento
问题描述
对于我所有的magento产品图像,我都从缓存URL获取图像.如何禁用它并使我的产品图像使用原始URL?
For all my magento product images i am getting the image from the cache url.How to disable it and make my product images to use the original url?
我在/public_html/dirname/app/code/core/Mage/Catalog/Helper/image.php文件中尝试了以下代码,但不支持.
I have tried with the below code in my /public_html/dirname/app/code/core/Mage/Catalog/Helper/image.php file but its not supporting.
Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getImage());
正是我需要使用代码的地方.否则建议解决此问题的解决方案.
Exactly where i need to use the code. or else suggest some solution to overcome this issue.
推荐答案
它对我有用.打开list.phtml文件找到此代码行.记事本++ 133
Its work for me.open list.phtml file locate this code line no. notepad++ 133
<img id="product-collection-image-<?php echo $_product->getId(); ?>"
src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(236,193); ?>"
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
使用此代码报废
<img width="236" height="193" id="product-collection-image-<?php echo $_product->getId(); ?>"
src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); ?>"
alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
仅适用于网格模式,您也可以更改为列表模式,并且产品详细信息页面medai.pthml文件仅在此文件src标记src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); ?>"
it only for grid mode you can change for list mode also and product details page medai.pthml file only change on this file src tag src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getSmallImage()); ?>"
这篇关于如何在magento中删除产品图像的缓存URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!