*/ class Webshopapps_Matrixrate_System_ConfigController extends Mage_Adminhtml_Controller_Action { /** * Export shipping table rates in csv format * */ public function exportmatrixAction() { $fileName = 'matrixrates.csv'; /** @var $gridBlock Mage_Adminhtml_Block_Shipping_Carrier_Tablerate_Grid */ $gridBlock = $this->getLayout()->createBlock('matrixrate_adminhtml/shipping_carrier_matrixrate_grid'); $website = Mage::app()->getWebsite($this->getRequest()->getParam('website')); if ($this->getRequest()->getParam('conditionName')) { $conditionName = $this->getRequest()->getParam('conditionName'); } else { $conditionName = $website->getConfig('carriers/matrixrate/condition_name'); } $gridBlock->setWebsiteId($website->getId())->setConditionName($conditionName); $content = $gridBlock->getCsvFile(); $this->_prepareDownloadResponse($fileName, $content); } }