public function exportAction()
    {
        $request = $this->getRequest();
        if (!$request->isPost()) {
            $this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
        }

        $orderIds = $this->getRequest()->getPost('order_ids', array());

        try {
            // Build the CSV and retrieve its path
            $filePath = Mage::getModel('australia/shipping_carrier_eparcel_export_csv')->exportOrders($orderIds);

            // Download the file
            $this->_prepareDownloadResponse(basename($filePath), file_get_contents($filePath));
        } catch (Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
            $this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
        }
    }
public function exportAction()
    {
        $request = $this->getRequest();
        if (!$request->isPost()) {
            $this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
        }

        $orderIds = $this->getRequest()->getPost('order_ids', array());

        try {
            // Build the CSV and retrieve its path
            $filePath = Mage::getModel('australia/shipping_carrier_eparcel_export_csv')->exportOrders($orderIds);

            // Download the file
            $this->_prepareDownloadResponse(basename($filePath), file_get_contents($filePath));
        } catch (Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
            $this->_redirect(self::ADMINHTML_SALES_ORDER_INDEX);
        }
    }
public function exportAction ( ) { $ request = $ this -> getRequest ( ) ; if ( ! $ request -> isPost ( ) ) { $ this -> _redirect ( self :: ADMINHTML_SALES_ORDER_INDEX ) ; } $ orderIds = $ this -> getRequest ( ) -> getPost ( 'order_ids' , array ( ) ) ; try { // Build the CSV and retrieve its path $ filePath = Mage :: getModel ( 'australia/shipping_carrier_eparcel_export_csv' ) -> exportOrders ( $ orderIds ) ; // Download the file $ this -> _prepareDownloadResponse ( basename ( $ filePath ) , file_get_contents ( $ filePath ) ) ; } catch ( Exception $ e ) { Mage :: getSingleton ( 'core/session' ) -> addError ( $ e -> getMessage ( ) ) ; $ this -> _redirect ( self :: ADMINHTML_SALES_ORDER_INDEX ) ; } }
Generate and export a CSV file for the given orders.
Generate and export a CSV file for the given orders .