How to remove the cache url for product images in

2019-05-26 10:45发布

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?

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.

1条回答
▲ chillily
2楼-- · 2019-05-26 11:09

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) ?>" />

repalce with this code

<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) ?>" />

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()); ?>"

查看更多
登录 后发表回答