I need to display points earned by customer on Order Information page under customer account.
module.xml
<sales_order_view>
<reference name="order_items">
<action method="addItemRender" ifconfig="mymodule/general/active"><type>default</type>
<block>sales/order_item_renderer_default</block>
<template>namespace/mymodule/sales/order/items/renderer/default.phtml</template>
</action>
</reference>
</sales_order_view>
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 ?>
</span>
</div>
<!--show points earned on each product-->
As shown in below image, this is how points earned are shown
- Is this the correct approach/method to show custom data on Order Information page ?
- 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 ?
sales/order/invoice/items/renderer/
sales/order/shipment/items/renderer/
sales/order/creditmemo/items/renderer/
Also, I am showing the same information in admin section by copying files in my extension
adminhtml\default\default\template\namespace\modulename\sales\order\total.phtml
P.S. The files belongs to community extension