2016-05-13 9 views
2

In Produktansicht Seite Seite werden die Bilder von diesem Weg dienen: link1in magento Website

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

aber ich will von diesem Weg dienen: link2

`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> 
+0

Mögliches Duplikat [Produktbilder dienen aus unterschiedlichen Pfaden auf Produktdetailseite und in Sitemap] (http://stackoverflow.com/ Fragen/37185755/product-images-serving-from-different-paths-on-produkt-detail-page-and-in-si) – codedge

Antwort

1

Sie müssen zuerst app/code/core/Mage/Katalog/Model/Product/Image.php zu app/code/local/Mage/Katalog/Model/Product/Image.php kopieren.

Dann nehmen Sie einen Blick auf die Datei, die Sie gerade kopiert, l.313-319:

// build new filename (most important params) 
    $path = array(
     Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(), 
     'cache', 
     Mage::app()->getStore()->getId(), 
     $path[] = $this->getDestinationSubdir() 
    ); 

Dieses "$ path" Array Ihr Katalog Bildpfad bauen. Ändern Sie es zu was auch immer Sie mögen. In Ihrem Fall:

// build new filename (most important params) 
    $path = array(
     Mage::getBaseDir('media'), 
     'cache/images', 
     Mage::app()->getStore()->getId(), 
     $path[] = $this->getDestinationSubdir() 
    ); 

Vergessen Sie nicht, zu klar Cache-Pfad zu ändern, l.686:

public function clearCache() 
{ 
    $directory = Mage::getBaseDir('media') . DS.'catalog'.DS.'product'.DS.'cache'.DS; 

... bis ...

public function clearCache() 
{ 
    $directory = Mage::getBaseDir('media') . DS.'cache'.DS.'images'.DS; 

Als nächstes gehen Sie zu Ihrem media.phtml Datei. Wechsel:

<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'image')); ?> 
... 
<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())); ?> 

... bis ...

<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'thumbnail')); ?> 
... 
<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())); ?> 
+0

Vielen Dank für Ihre Unterstützung, Entschuldigung für die Verzögerung, verwenden wir eine Erweiterung: https: //www.magentocommerce.com/magento-connect/dexxtz-product-zoom.html, jetzt setze ich Bildgröße mit Backend, also bekomme ich den Pfad, den ich benötigte, aber Bilder werden in sehr großer Größe in der Site [hier] angezeigt (http://test.collagekingapp.com/baby-ball-large .html) – fresher

+0

Sie können einen "resize" Parameter wie folgt hinzufügen: ' getImageFeatured ($ this-> helper ('katalog/bild')) -> init ($ this-> getProduct(), 'thumbnail', $ _image-> getFile())) -> resize (300,300); ?> 'wo das erste Argument die Breite ist und das zweite die Höhe. –