Created a custom attribute and assigned it to all attribute set for Magento 1.9 Sample Data. I have set Visible on Product View page and Product Listing page to YES.


Assigned attribute value to product as shown below

Product Points

The attribute value is shown under additional information on product details page. How do I show it as shown in below image using layout. Which block do I need to change ? My extension resides under app/code/local/

points details

  • does solve your problem
    – Gem
    Nov 21, 2016 at 14:18

2 Answers 2


I'm confused a bit. You state you created a custom attribute. You then speak of using an extension in app/code/local. Why do you need an extension for placing an attribute?

Have you considered adding to /app/design/frontend/yourtheme/default/template/catalog/product/view.phtml something like this?

<p>YOU WILL EARN <?php echo $_product->getAttributeText('customer_product_points') ?> POINTS FOR PURCHASING THIS PRODUCT.</p>
  • I am able to display the attribute but not at the specified location. Rest is done. Jan 4, 2016 at 5:41
  • Make sure <?php $_product = $this->getProduct(); ?> appears in the beginning of the document.
    – Scot
    Jan 7, 2016 at 1:08

Add following code to inject custom attribute on Product Detail Page.

Add following code in your module.xml of frontend.

    <reference name="product.info.addtocart">
        <block type="core/text_list" name="block.view">
        <block type="module/block" name="block.cart.view" as ="blockview" template="Namespace/Module/cart/view.phtml"/> 

Create file: app\design\frontend\base\default\template\namespace\module\cart\view.phtml

And add following code in view.phtml -

$_proId= Mage::registry('current_product')->getId();
$_product= Mage::getModel('catalog/product')->load($_proId);
$CustomAttribute= $_product->getData('custom_attribute');
echo $CustomAttribute;    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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