Magento – Add Attribute Values to Order View Page Section

admin-panelattributesorders

enter image description herein the magento admin panel, if we go for Orders section

and if we click on one order, we can see the Product name and sku at the bottom.

i want to add 2 more attributes to the order section.

please help me to find solution.

thanks in advance.

Best Answer

You didn't specify the Magento version but here is the solution for CE 1.8.1.0 (might also work for others):

The product name and SKU are output in app/design/adminhtml/default/default/template/sales/items/column/name.phtml. You will find a variable $_item which is an object of the class Mage_Sales_Model_Order_Item.

If you want to output data which is saved in the order item, you can directly use the order item:

<?php echo $this->escapeHtml($_item->getSomeValue()) ?>

If you need data which is only saved in the product itself, you can get the product and echo its value:

<?php echo $_item->getProduct()->getDescription(); ?>

Be aware that the same template is used for other pages like the invoice, shipment page and so on and there may be different templates for other product types.

Related Topic