When 'sales_bestsellers_aggregated_daily' table will get update data?
-
28-09-2020 - |
Question
In my local 'sales_bestsellers_aggregated_daily' table is empty, But I need to get the best selling products from this table. I made an order and created shipments also. But this table is empty.
Is anybody knows when this 'sales_bestsellers_aggregated_daily' will get update with product data?
Solution
Sales module has a cronjob defined in magento/module-sales/etc/crontab.xml:
<job name="aggregate_sales_report_bestsellers_data" instance="Magento\Sales\Model\CronJob\AggregateSalesReportBestsellersData" method="execute">
<schedule>0 0 * * *</schedule>
</job>
So you have to configure your Magento's cron to be running properly and bestsellers tables are going to be populated at 00:00
on your store time.
OTHER TIPS
Admin panel has a section Reports/Refresh Statistics. Select an item(Bestsellers) and press submit.
As @Fel1xx Mentioned, sales_bestsellers_aggregated_daily will get updated at 00:00 every day . If you are doing development, and you want to see this table updated immediately when you have placed some orders, you can run manually this cron job 'aggregate_sales_report_bestsellers_data' using magerun2
magerun2 sys:cron:run then enter 2 which stays for aggregate_sales_report_bestsellers_data .
It will populate that table for you .