Magento CMS is the most preferred eCommerce content management system. Its unique and advanced features make customizations easy. Creative and dynamic portals can be created using Magento. The best part of Magento is its flexibility. This post covers how to show Magento product images using different methods.
There are a number of ways by which we can show Magento product images for an online store. Few of the most common and functioning methods are highlighted below. Paste the codes to show Magento product images wherever you wish:
$collection = Mage::getModel('catalog/product')->getCollection(); $collection->addFieldToFilter(array( array('attribute'=>'vendor_code','eq'=>'39'), )); $collection->addAttributeToSelect('*'); foreach ($collection as $product) { $prod = Mage::helper('catalog/product')->getProduct($product->getId(), null, null); $attributes = $prod->getTypeInstance(true)->getSetAttributes($prod); $galleryData = $prod->getData('media_gallery'); foreach ($galleryData['images'] as &$image) { var_dump($image); } }