Skip to main content
1 of 2
Ramya
  • 1.1k
  • 2
  • 19
  • 48

Image is getting broken when called at frontend

In magento1.9.2.4 when I created multiple select attribute with options and images for those options are placed in skin/frontend/<my_package>/<my_theme>/images/ and called the attribute in list.phtml like

 <?php
  $Feature = explode(",",$_product->getResource()
  ->getAttribute('feature')->getFrontend()
  ->getValue($_product));

 foreach($Feature as $key => $value): ?>
                            
<?php echo "<img src='".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."frontend/<package_name>/<theme_name>/images/".$value.".png'/>"; ?>
                    
<?php endforeach; ?>

Now only the first image of the option is displaying. Other images are broken. When I Inspected the element in browser there was space before the image name. am not able to figure out the mistake. Kindly help me please.

Ramya
  • 1.1k
  • 2
  • 19
  • 48