Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tegansnyder/4420972 to your computer and use it in GitHub Desktop.
Save tegansnyder/4420972 to your computer and use it in GitHub Desktop.
To add a export button to Magento Recurring Profiles edit this file: /app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php
<?php
// ADD THIS CODE
/**
* Export order grid to CSV format
*/
public function exportCsvAction()
{
$fileName = 'subscriptions.csv';
$grid = $this->getLayout()->createBlock('sales/adminhtml_recurring_profile_grid');
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
}
/**
* Export order grid to Excel XML format
*/
public function exportExcelAction()
{
$fileName = 'subscriptions.xml';
$grid = $this->getLayout()->createBlock('sales/adminhtml_recurring_profile_grid');
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
}
?>
@vinodlko
Copy link

Added the code but nothing is showing for export ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment