Php 如何在Magento中获取排序顺序范围内的MediaGalleryImage?
我是马根托的新手 如何在Magento中获取排序顺序范围内的MediaGalleryImage?我是magento的新手,希望获得订单范围(比如10-20)内产品的所有图像 这就是我到目前为止所做的:Php 如何在Magento中获取排序顺序范围内的MediaGalleryImage?,php,magento,sorting,Php,Magento,Sorting,我是马根托的新手 如何在Magento中获取排序顺序范围内的MediaGalleryImage?我是magento的新手,希望获得订单范围(比如10-20)内产品的所有图像 这就是我到目前为止所做的: <?php $_images = Mage::getModel('catalog/product')->load($_product->getId())- >getMediaGalleryImages();?>();?><?php if($_image
<?php $_images = Mage::getModel('catalog/product')->load($_product->getId())- >getMediaGalleryImages();?>();?><?php if($_images){?><?php $i=0; foreach($_images as $_image) if ($i++ < 8) { $i++;?>
();?>
欢迎任何帮助
谢谢你的回答,但是,我不太明白。我想在产品列表页面上的我的产品下面显示大拇指。我确信你给出的代码是正确的,但我没有正确地实现它。以下是我目前拥有的完整代码:
<?php $_images = Mage::getModel('catalog/product')->load($_product->getId())- >getMediaGalleryImages();?>
<?php if($_images){?>
<?php $i=0; foreach($_images as $_image){ $i++; if($i>=10 && $i<=20);?>
<a href="#">
<img src="<?php echo $helpImg->getImg($_product, $bigImageWidth, $bigImageHeight, 'image', $_image->getFile()); ?>" class="cloud-zoom-gallery lightbox-group"
title="<?php echo $this->escapeHtml($_image->getLabel()); ?>" width="25" height="25" alt="<? =$this->htmlEscape($_image->getLabel());?>" title="<?=$this->htmlEscape($_image->getLabel());?>" />
getImg($\u product,$bigImageWidth,$bigImageHeight,'image',$\u image->getFile());?>“class=”云缩放库灯箱组”
title=”“width=“25”height=“25”alt=”“title=”“/>
您可以通过执行以下代码来完成
helper('catalog/image')->init($_product,'thumbnail',$_image->getFile())->调整大小(108,90);?>“alt=”“title=”“/>
您需要更改代码
$_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
$i=1;
foreach($_images as $_image){
if($i > 10 && $i < 20){
echo $_image['url'];
}
$i++;
}
$\u images=Mage::getModel('catalog/product')->load($\u product->getId())->getMediaGalleryImages();
$i=1;
foreach($\图像作为$\图像){
如果($i>10&$i<20){
echo$_图像['url'];
}
$i++;
}