Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Get All Product Images in list.phtml
 
pinky72
Jr. Member
 
Total Posts:  13
Joined:  2008-12-15
 

Hi,
in list.phtml I need to show all images of each product and not only the small_image.

Like in media.phtml I find the image gallery with this code:

<?php foreach ($this->getGalleryImages() as $_image): ?>
        
<li>
            <
a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=50,top=50,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(206); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
        </
li>
    
<?php endforeach; ?>

I’d like to replicate the same situation also in list.phtml but when I insert this statement:

<?php $itemImages $_product->getMediaGalleryImages(); ?>
I obtain null.
If I insert after this ....
]<?php echo count($itemImages); ?> [/codeI obtain 0.
May you help me to find a solution?
 
Magento Community Magento Community
Magento Community
Magento Community
 
guy_design
Jr. Member
 
Total Posts:  9
Joined:  2010-11-10
 

same here , would like to know how echo getGalleryImages() works.
thanx

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagePsycho
Moderator
 
Avatar
Total Posts:  1702
Joined:  2009-06-23
 

$_product->getMediaGalleryImages() should work i think.
$_product->getGalleryImages() will work in case of media.phtml file only as it is the method of the block: Mage_Catalog_Block_Product_View_Media

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top