Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

you need to adjust app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml This is the table you are looking for. Add what ever you want to add here :)

This works great. However if the product is variable it will not work. I Need a barcode "EAN" to be displayed as attribute. It works as single products but show empty as variable.

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

How to solve that?

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top