I created a multiselect attribute with label featuredetails. I created a static block and called the feature.phtml file(a newly created phtml file) in it like:

<div id="tab3" class="tab">
      <p>{{block type="core/template" template="catalog/product/view/feature.phtml"}}</p>

The content of the phtml file is:

   $_prodID = Mage::registry('current_product')->getId();
   $_product = Mage::getModel('catalog/product')->load($_prodID );

<div class="feature">

        $Feature = explode(",",$_product->getResource()
        foreach($Feature as $key => $value): ?>
        <a href="<?php echo $_product->getProductUrl() ?>" ?>
            <?php echo "<img   src='".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."/wysiwyg/".trim($value).".png'/>"; ?>

       <?php endforeach; ?> 

The content of the block will map the attributes with the media images.

But am getting error like: Fatal error: Call to a member function getFrontend() on boolean

Help me to resolve this error.


It looks like the attribute isn't created or attribute_code is mismatch. Please try to find attribute with attribute_code featuredetails in Attribute Grid.

Please check the following code with your attribute_code

$attributeInstance = Mage::getSingleton('eav/config')
    ->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'featuredetails');

As a result you should see attribute_id.

| improve this answer | |
  • should i include this in my code? – Ramya May 24 '16 at 6:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.