0
在Magento中,有沒有人知道如何限制顯示在主要產品圖像下的縮略圖數量?如何限制Magento產品頁面中產品縮略圖的數量
這是很容易通過管理員控制的,或者我應該進入media.phtml並編輯php?
<div class="more-views">
<ul>
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li>
<a href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>" title="<?php echo $_product->getName();?>" onclick="$('image').src = this.href; return false;">
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(103, 103); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
這正是我所期待的。將其包裝在for循環中並針對變量$ limit運行。我很困惑:'$ ct = 0'正在被使用。 –
爲了保持已經顯示多少圖像的計數,因爲我使用的是「foreach」循環而不是「for」循環。由於'getGalleryImages()'返回一個對象,該對象的索引可能不是從0開始,而是在中間 –