File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
app/code/core/Mage/Reports Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * Reports Observer
5+ */
6+ class Mage_Reports_Model_Observer
7+ {
8+ /**
9+ * Refresh viewed report statistics for last day
10+ *
11+ * @param Mage_Cron_Model_Schedule $schedule
12+ * @return $this
13+ */
14+ public function aggregateReportsReportProductViewedData ($ schedule )
15+ {
16+ Mage::app ()->getLocale ()->emulate (0 );
17+ $ currentDate = Mage::app ()->getLocale ()->date ();
18+ $ date = $ currentDate ->subHour (25 );
19+ Mage::getResourceModel ('reports/report_product_viewed ' )->aggregate ($ date );
20+ Mage::app ()->getLocale ()->revert ();
21+ return $ this ;
22+ }
23+ }
Original file line number Diff line number Diff line change 206206 </dashboard >
207207 </reports >
208208 </default >
209+ <crontab >
210+ <jobs >
211+ <aggregate_reports_report_product_viewed_data >
212+ <schedule >
213+ <cron_expr >0 0 * * *</cron_expr >
214+ </schedule >
215+ <run >
216+ <model >reports/observer::aggregateReportsReportProductViewedData</model >
217+ </run >
218+ </aggregate_reports_report_product_viewed_data >
219+ </jobs >
220+ </crontab >
209221</config >
You can’t perform that action at this time.
0 commit comments