Currently, when we login to magento admin, it shows the order amount from last 24 hours by default. Is there a way to show Current Date (today) order amount as default?
A detailed solution will be much appreciated.
Currently, when we login to magento admin, it shows the order amount from last 24 hours by default. Is there a way to show Current Date (today) order amount as default?
A detailed solution will be much appreciated.
Copy app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php
to
app/code/local/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php
goto Mage_Adminhtml_Block_Dashboard_Orders_Grid and goto _prepareCollection...
change: from
$collection = Mage::getResourceModel('reports/order_collection')
->addItemCountExpr()
->joinCustomerName('customer')
->orderByCreatedAt();
to
$collection = Mage::getResourceModel('reports/order_collection')
->addItemCountExpr()
->joinCustomerName('customer');
$todayStartOfDayDate = Mage::app()->getLocale()->date()
->setTime('00:00:00')
->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$todayEndOfDayDate = Mage::app()->getLocale()->date()
->setTime('23:59:59')
->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$collection->addAttributeToFilter('created_at', array(
'from' => $todayStartOfDayDate,
'to' => $todayEndOfDayDate,
));