I need to display points earned by customer on Order Information page under customer account.


    <reference name="order_items">
        <action method="addItemRender" ifconfig="mymodule/general/active"><type>default</type>

Copied file from core - sales/order/items/renderer/default.phtml to namespace/mymodule/sales/order/items/renderer/default.phtml and along with default code, I added mine

<!--show points earned on each product-->
<?php $finalPointsEarned = ($_item->getCustomerProductPoints() * $_item->getQtyOrdered()); ?>
<div class="product-cart-sku">
    <span style="color: #d4af37; font-weight: bold;"><?php echo $this->__('Points Earned:'); ?>
        <?php echo $finalPointsEarned ?>
<!--show points earned on each product-->

As shown in below image, this is how points earned are shown


  1. Is this the correct approach/method to show custom data on Order Information page ?
  2. If not, how do I override Sales/Order/Item/Rendered/Default block to show the same without copying core file in my extension and then adding my code ?

Will it be same for below mentioned files too ?


Also, I am showing the same information in admin section by copying files in my extension


P.S. The files belongs to community extension





    <reference name="invoice_items">
        <block type="core/text_list" name="invoice.productpoints.info" translate="label">
            <label>Additional Points Info</label>



class Namespace_Modulename_Block_Sales_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
    public function getInvoiceProductPoints()
        $_item = $this->getItem();
        $finalPointsEarned = ($_item->getCustomerProductPoints() * $_item->getQty());
        return $finalPointsEarned;


<?php $addInfoBlock = $this->getInvoiceProductPoints(); ?>
<?php if ($addInfoBlock): ?>
    <?php echo $addInfoBlock ?>
<?php endif;?>

1 Answer 1


1.) Correct : Well, it largely depends upon the file/situation you are working in. But lot of core templates allow third party extensions to inject their code in a much decent manner, your condition happens to be one of those.

2.) Instead of copying over the entire core file, take a look at the template and layout files for the same. Inside template, you can see that there is a code block as <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>.

Now, if you search in corresponding block for the same, you'll see, it is calling the handle additional.product.info from layout, and in layout, it is core/text_list type of block. There you have it. You can simply reference your custom code aiming at this handle and Magento will pick up your information for the display and you won't need to copy over the entire template file to your extension.

Try this approach and see if you get a cleaner extension.

  • Prateek: Would be great if you could post some code snippet for Point #2 you mentioned considering block Commented Mar 18, 2016 at 11:03
  • See CODE EDIT above. I still do not show core block being called. Do I need to put the core html file and then inject my block ? Commented Mar 21, 2016 at 6:41

Your Answer

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

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