Trying to gather all the orders (current day) and sum totals
Updated:
$format = Mage::getModel('core/date')->date('Y/m/d');
$from = $format.' 00:00:00';
$now = Mage::getModel('core/date')->date('Y/m/d H:m:i');
$torders = Mage::getModel('sales/order')
->getCollection()
->addAttributeToSort('increment_id', 'DESC')
->addFieldToFilter('state',Array('neq'=>Mage_Sales_Model_Order::STATE_NEW))
->addAttributeToFilter('created_at', array('from' => $from,'to' => $now))
;
everything is fine except one little thing, one of the orders seems to be not in collection.
Checked all customer_emails
and the order created just before midnight (00:14:46) is not included in collection for some reason.
suppose to be 127 order while getSize()
is saying 126 regardless what filters used etc.
Any ideas ?
Best Answer
Try this