I have created a multiselect
attribute named feature
and have associated an image for every option created for that attribute. And I have displayed this attribute value inside the product collateral tab. As far in the product collateral tab, If the attribute displayed inside it don't have any value, that particular tab will be hidden. But with this feature
attribute, even when no option is selected it is displaying broken image.
The code to fetch an image for each option of the feature
attribute is :
<?php
$_prodID = Mage::registry('current_product')->getId();
$_product = Mage::getModel('catalog/product')->load($_prodID );
?>
<div class="feature">
<?php
$Feature = explode(",",$_product->getResource()
->getAttribute('featuredetail')->getFrontend()
->getValue($_product));
foreach($Feature as $key => $value): ?>
<a class="feature-label" "href="<?php echo $_product->getProductUrl() ?>" ?>
<?php echo "<img src='".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."wysiwyg/feature/detail/".trim($value).".png'/>"; ?>
</a>
<?php echo $value; ?>
<?php endforeach; ?>
</div>
I think this feature.phtml
is reponsible for that broken image to get displayed even when no value is selected. What should be done to fix this issue.Please kindly help me.