original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: Generate and export a CSV file for the given orders.
docstring_tokens: Generate and export a CSV file for the given orders .