0
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..

0

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');
0

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:

<sales>
  <quote>
    <item>
      <product_attributes>
        <my_attribute/>
      </product_attributes>
    </item>
  </quote>
</sales>

I hope that this helps.

1
  • 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.