0

In product view page page, images are serving from this path :

media/catalog/product/cache/1/image/350x350/9df78eab33525d08d6e5fb8d27136e95/c/h/image-name.jpg :

but I want to serve from this path :

`media/cache/images/1/thumbnail/602f0fa2c1f0d1ba5e241f914e856ff9/catalog/product/c/image-name.jpg` : 

media.phtml

<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
    $dexxtz = Mage::helper('productzoom');

    $dexxtz->getCss();
    $dexxtz->getJs();
?>

<ul id="etalage">
    <li>                
        <img class="etalage_thumb_image" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'image')); ?>" />
        <img class="etalage_source_image" title="<?php echo $_product->getImageLabel(); ?>" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'image'), true); ?>" />
    </li>
    <?php 
        foreach ($this->getGalleryImages() as $_image) {
            if(Mage::registry('current_product')->getImage() != $_image->getFile()) { ?>                
            <li>
                <img class="etalage_thumb_image" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())); ?>" />
                <img class="etalage_source_image" title="<?php echo $_image->getLabel(); ?>" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()), true); ?>" />
            </li> 
        <?php 
            }    
        }
    ?>   
</ul>

or i want to display big size images in product page.

  • You want to display thumbnail images in big size ? – Suresh Chikani May 13 '16 at 10:24
  • @SHPatel if you help me to serve images from this path, it will be really helpfull for me : media/cache/images/1/thumbnail/602f0fa2c1f0d1ba5e241f914e856ff9/catalog/product/c/image-name.jpg – user38259 May 13 '16 at 10:25
  • <?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(135,135); ?> – Suresh Chikani May 13 '16 at 10:30
  • @SHPatel Now its coming from this path : media/catalog/product/cache/1/thumbnail/835x835/9df78eab33525d08d6e5fb8d27136e95/c/h/image-name.jpg – user38259 May 13 '16 at 10:34
  • Yes, Please add my above reference code it will give you thumbnail images from you have given path. Have you use my code and checked or not ? – Suresh Chikani May 13 '16 at 10:37
0

For this locate the following file.

app\design\frontend\<package_name>\<theme_name>\template\catalog\product\view\media.phtml

near line no near 40-45 you will find a code of image like

<img id="image-main"
             class="gallery-image visible"
             src="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>"
             alt="<?php echo $this->escapeHtml($this->getImageLabel()) ?>"
             title="<?php echo $this->escapeHtml($this->getImageLabel()); ?>" />

Replace this code By

<img id="image-main"
             class="gallery-image visible"
             src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail'); ?>"
             alt="<?php echo $this->escapeHtml($this->getImageLabel()) ?>"
             title="<?php echo $this->escapeHtml($this->getImageLabel()); ?>" />

That's it you will get a changed path for a image.

Please not you will get a image here which you set as a Thumbnail image in admin for a product.

  • we are using custom module to serve the images, i posted code of media.phtml in question. please update the answer with code for that media.phtml – user38259 May 13 '16 at 10:43
  • can you please tell me which is you main image i.e. for which image you want to change a path the one who is having etalage_source_image as a class name second <img> tag of first <li> tag ? – Ashish Madankar M2 Professiona May 13 '16 at 10:49
  • i have to chnage this line of code : <img class="etalage_thumb_image" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'image')); ?>" /> – user38259 May 13 '16 at 10:51
  • replace that code with <img class="etalage_thumb_image" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'thumbnail')); ?>". – Ashish Madankar M2 Professiona May 13 '16 at 10:53
  • now its serving from this path : media/catalog/product/cache/1/thumbnail/350x350/9df78eab33525d08d6e5fb8d27136e95/c/h/image-name.jpg – user38259 May 13 '16 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy