1
我可以看到media.phtml(帶有Cloud Zoom擴展)如何在$ this-> getGalleryImages()的幫助下列出產品頁面上的所有圖像:Magento:顯示產品頁面上的所有圖像(view.phtml)
<?php foreach ($this->getGalleryImages() as $_image): ?>
<?php ... ?>
<?php endforeach; ?>
但是,當我在view.phtml這是產品目錄頁面模板使用$這 - > getGalleryImages(),它不返回或輸出任何東西。然而,這隻能打印產品頁面上的第一個圖像:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->setWatermarkImageOpacity(0)->resize(300, null);?>" alt="<?php echo $this->htmlEscape($this->getImageLabel());?>" title="<?php echo $this->htmlEscape($this->getImageLabel());?>" />
我的問題是我怎麼能遍歷並顯示產品頁面上的所有產品圖片(view.phtml,不media.phtml)?基本上,我希望他們都在頁面上顯示,而不用縮略圖或縮放或任何東西,只是簡單的大圖像,一個接一個。
謝謝!