1

I wanna export CSV from sales -> orders grid with only selected lines and not all commands like with the default button.

If there's a solution for that ?

Thank you for advance

2
  • can you put your demo csv
    – Amit Bera
    Sep 26, 2014 at 11:53
  • I only wanna export the orders grid but only with the selected commands (with the 1st column) and not all commands like the default export button Sep 26, 2014 at 13:09

1 Answer 1

1

So what happens when the order csv is run is the following.

  1. The action Mage_Adminhtml_Sales_OrderController::exportCsvAction is called,
  2. This creates a grid block with $this->getLayout()->createBlock('adminhtml/sales_order_grid');,
  3. This grid is then used to fill the csv in Mage_Adminhtml_Block_Widget_Grid::_exportIterateCollection

What you could do is rewrite the admin controller or make your own controller and then use this in the admin section. Then instead of simply getting a complete sales order grid you can build the grid with the correct collection including the filters selected by the user.

1
  • Suppose we use the normal CSV Export action as an example? HOw could we then export by ` $orderIds = $this->getRequest()->getPost('order_ids', array());` : export $orderIds only from collection?
    – snh_nl
    Jan 6, 2017 at 7:39

Your Answer

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

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