1

There are 3 tables related to bestseller in Magento 2

 sales_bestsellers_aggregated_daily
 sales_bestsellers_aggregated_monthly
 sales_bestsellers_aggregated_yearly

How and when these tables get populated. Is there any sort of cron that populates these tables as soon as a user completes an order?

data's are wrong on these 3 tables, 90% of products don't exist in catalog_product_entity That product_id from these 3 tables sales_bestsellers_aggregated_daily sales_bestsellers_aggregated_monthly sales_bestsellers_aggregated_yearly doesn't exist anywhere

1

When you "refresh statistics" for "Bestsellers Report" those tables get populated.

Refer magneto doc about reports : https://docs.magento.com/m2/ce/user_guide/reports/product-reports.html

refresh statistics link

  • 1
    How about crontab.xml which has this code <job name="aggregate_sales_report_bestsellers_data" instance="Magento\Sales\Model\CronJob\AggregateSalesReportBestsellersData" method="execute"> <schedule>0 0 * * *</schedule> </job> , this states that the cron job will run every 00:00 hours, what does this cron job do ? – summu Oct 31 at 13:24
  • Yes that is correct. I was wrong about cron job. – Mathew Lawrence Oct 31 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.