0

i want to edit sales_order listing view to add new column but i can not find that template to edit.

i want to edit .phtml file not Block

this is url that i want to edit on it

http://localhost/ProjectName/index.php/admin/sales_order/

enter image description here

5
  • The admin grids do not work as you think they do. They all use the same PHTML templates, so to add columns to a specific grid, you need to modify the block behavior for this grid. This is best done with an observer. Commented Jun 22, 2016 at 10:38
  • (see answer by Vladimir Kerkhoff in the linked duplicate) Commented Jun 22, 2016 at 10:41
  • but where is the code which i loop in orders to add my new value Commented Jun 22, 2016 at 10:45
  • It does not work like that. Please read the example I gave you carefully. Commented Jun 22, 2016 at 10:47
  • ok i read it and unterstand it . i created marketplace that allows customer to add product from front end and then i want to list for this customer orders for his product $customerData = Mage::getSingleton('customer/session')->getCustomer(); $customer_id = $customerData->getId(); $collection = Mage::getModel('catalog/product')->getCollection(); $collection->addAttributeToSelect('*'); $collection->addFieldToFilter(array( array('attribute'=>'customer_id','eq'=>$customer_id) )); $ids=array(); foreach ($collection as $product) { $ids[]=$product->getId(); } Commented Jun 22, 2016 at 10:50

1 Answer 1

0

You need to rewrite the sales_order_grid block in your config.xml file in order to add new column in order listing.

<sales_order_grid>Namespace_Modulename_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>

Then create above class in your module & extend it from - Mage_Adminhtml_Block_Widget_Grid

Under _prepareColumns() function add your new column & value.

Hope this will help you.

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