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

Problem with headers exporting xml file…
 
alexbn
Sr. Member
 
Avatar
Total Posts:  167
Joined:  2009-04-22
Milano
 

I am doing an export of orders.

The “compressed” code is:

$xml '<?xml version="1.0" encoding="UTF-8"?>'."\n";
        
$xml .= '  <Documents>'."\n";
        ...
        ...
        ...
            
//$orderPayment = $order->getPayment()->getMethodInstance();
        
...
        ...    
        ...
        
$xml .= '  </Documents>'."\n";

        echo 
$xml;

all work well, the xml file is perfect without the commented line.
In my export I need to retrive payment information so I added the line $orderPayment = $order->getPayment()->getMethodInstance();
Strangely this line of code causes sending headers!!! So my xml header “<?xml version="1.0" encoding="UTF-8"?>" insn’t on the first line but is preceded by headers.
The PC program that make the request to my php script then give me an error for xml not well formatted!
Can someone tell me why this happens?

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