Value is showing on front page under custom tab section but bullets or images are not coming.  

I am using this code in phtml file

code 1:

$_product = $this->getProduct();
echo $_product->getData('customattribute');  

Or Code 2:

<?php if($_product->getCustomattribute()!= null){ ?>
       <div class="similarproduct">
       <div class="coloroptions">Color Options : </div>
       <?php echo $_helper->productAttribute($_product, ($_product->getCustomattribute()), 'customattribute') ?></div>
<?php } ?>

code 2 : Gives me error code 1 : Print every thing except bullets/images just simple text.

Kindly suggest any method . i follow almost all post related to this..


I finally I got the answer to this question may be it helps some one.

I used this code in my custom phtml file to show custom attribute value in same way as it is entered in product creation time.

Add below code in customareamaddy.phtml

$productId = Mage::registry('current_product')->getId();
$_product = Mage::getModel('catalog/product')->load($productId);
$_helper = $this->helper('catalog/output');
echo $_helper->productAttribute($_product, ($_product->getCustomareamaddy()), 'customareamaddy');

If you have custom Module for your page, you have to add your attribute to config.xml of this module. This is an example for adding it into cart page:


I hope that this helps.

  • I added a custom tab on view page using local.xml – inrsaurabh Mar 29 '17 at 13:25

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.