Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在magento中获取与单个产品相关的图像_Php_Magento - Fatal编程技术网

Php 如何在magento中获取与单个产品相关的图像

Php 如何在magento中获取与单个产品相关的图像,php,magento,Php,Magento,我想得到每一个产品相关的图像,这不是分配给产品,但想在前端显示所有相关的图像 尝试以下代码获取所有库图像: $product_image_url_gallery = $product->getMediaGalleryImages(); $galleryURL = ''; echo '<ul class="outfit-images-cmt">'; foreach ($product_image_url_gallery as $image) { $galleryImag

我想得到每一个产品相关的图像,这不是分配给产品,但想在前端显示所有相关的图像



尝试以下代码获取所有库图像:

$product_image_url_gallery = $product->getMediaGalleryImages();
$galleryURL = '';
echo '<ul class="outfit-images-cmt">';

foreach ($product_image_url_gallery as $image) {
  $galleryImage = Mage::helper('catalog/image')->init($product, 'image', $image->getFile());
   echo '<li><img src="'.$galleryURL.'"></li>'
}

echo '</ul>';
$product\u image\u url\u gallery=$product->getMediaGalleryImage();
$galleryURL='';
echo'
    ; foreach($product\u image\u url\u gallery作为$image){ $galleryImage=Mage::helper('catalog/image')->init($product,'image',$image->getFile()); 回音“
  • ” } 回声“
”;
 <ul class="outfit-images-cmt">
                <li><img src="<?php echo $this->getSkinUrl() ?>whi/assets/images/doll.png"></li>
                <li><img src="<?php echo $this->getSkinUrl() ?>whi/assets/images/doll.png"></li>
                <li><img src="<?php echo $this->getSkinUrl() ?>whi/assets/images/doll.png"></li>
                <li><img src="<?php echo $this->getSkinUrl() ?>whi/assets/images/doll.png"></li>
                </ul>
$product_image_url_gallery = $product->getMediaGalleryImages();
$galleryURL = '';
echo '<ul class="outfit-images-cmt">';

foreach ($product_image_url_gallery as $image) {
  $galleryImage = Mage::helper('catalog/image')->init($product, 'image', $image->getFile());
   echo '<li><img src="'.$galleryURL.'"></li>'
}

echo '</ul>';