Hello,
this scripts works fine for me to export current orders but i also need to add purchaed item(s) to this current order export. Can any one provide me the code.
i am using following code as you mention above and it works for me perfectly but i am not able to include purchaed item(s) into export. Thanks in advance.
require_once 'app/Mage.php';
Mage::app('default');
$myOrder=Mage::getModel('sales/order');
$orders=Mage::getModel('sales/mysql4_order_collection');
//Optional filters you might want to use - more available operations in method _getConditionSql in Varien_Data_Collection_Db.
$orders->addFieldToFilter('total_paid',Array('gt'=>0)); //Amount paid larger than 0
$orders->addFieldToFilter('status',Array('eq'=>"processing")); //Status is "processing"
$allIds=$orders->getAllIds();
//print_r($allIds);
foreach($allIds as $thisId) {
//$myOrder->load($thisId);
$myOrder->reset()->load($thisId);
echo "
";
print_r($myOrder);
echo "
";
//Some random fields
echo "'" . $myOrder->getBillingAddress()->getFirstname() . "',";
echo "'" . $myOrder->getBillingAddress()->getLastname() . "',";
echo "'" . $myOrder->getTotal_paid() . "',";
echo "'" . $myOrder->getShippingAddress()->getTelephone() . "',";
echo "'" . $myOrder->getPayment()->getCc_type() . "',";
echo "'" . $myOrder->getStatus() . "',";
echo "\r\n";
}