Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

“You cannot define a correlation name ‘sop’ more than once” error when i try to export transactions into csv
 
elliferns
Jr. Member
 
Total Posts:  2
Joined:  2012-01-16
 

Hi

I am trying to export the transaction data into csv.
To achieve this I have added following line of code

$this->addExportType(’*/*/exportCsv’, Mage::helper(’sales’)->__(’CSV’));

to

“protected function _prepareColumns()” function in app/code/core/Mage/Adminhtml/Block/Sales/Transactions/grid.php file.

Also I have added an action exportCsvAction in /app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php

public function exportCsvAction()
{
$fileName = ‘transactions.csv’;
$grid = $this->getLayout()->createBlock(’adminhtml/sales_transactions_grid’);
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
}

Now, when i try to export the transactions data I get error saying “You cannot define a correlation name ‘sop’ more than once”.

Can anyone help me on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
elliferns
Jr. Member
 
Total Posts:  2
Joined:  2012-01-16
 

Below is the error that i can see:

a:5:{i:0;s:57:"You cannot define a correlation name ‘sop’ more than once";i:1;s:1655:"#0 /var/www/demos/site-3197/lib/Zend/Db/Select.php(336): Zend_Db_Select->_join(’inner join’, Array, ‘main_table.paym...’, Array, NULL)
#1 /var/www/demos/site-3197/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php(214): Zend_Db_Select->joinInner(Array, ‘main_table.paym...’, Array)
#2 /var/www/demos/site-3197/lib/Varien/Data/Collection/Db.php(613): Mage_Sales_Model_Mysql4_Order_Payment_Transaction_Collection->_beforeLoad()
#3 /var/www/demos/site-3197/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(923): Varien_Data_Collection_Db->load()
#4 /var/www/demos/site-3197/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(980): Mage_Adminhtml_Block_Widget_Grid->_exportIterateCollection(’_exportCsvItem’, Array)
#5 /var/www/demos/site-3197/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php(66): Mage_Adminhtml_Block_Widget_Grid->getCsvFile()
#6 /var/www/demos/site-3197/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_Sales_TransactionsController->exportCsvAction()
#7 /var/www/demos/site-3197/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch(’exportCsv’)
#8 /var/www/demos/site-3197/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /var/www/demos/site-3197/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#10 /var/www/demos/site-3197/app/Mage.php(627): Mage_Core_Model_App->run(Array)
#11 /var/www/demos/site-3197/index.php(80): Mage::run(’’, ‘store’)
#12 {main}”;s:3:"url”;s:115:"/index.php/admin/sales_transactions/exportCsv/key/2d4713481f9441b2a390a1642f52825b4dc189c532929e243e603702c685cf80/”;s:11:"script_name”;s:10:"/index.php”;s:4:"skin”;s:5:"admin";}

 
Magento Community Magento Community
Magento Community
Magento Community
 
sarvagya
Jr. Member
 
Total Posts:  5
Joined:  2012-05-10
 

Hello ,

I also have the same problem and same error . have you found the solution ??
Please help

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top