Skip to main content
added 93 characters in body
Source Link
Ramya
  • 1.1k
  • 2
  • 19
  • 48

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.

Also when the image is clicked it should redirect to the respective product details page.

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.

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.

Also when the image is clicked it should redirect to the respective product details page.

Source Link
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.