WordPress database error Unknown column ‘wp_wc_order_stats.total_sales’
-
Since WP upgrade to 6.0.1 and WC to 6.7.0 I can see the following errors in the server logs.
Got error ‘PHP message: WordPress database error Unknown column ‘wp_wc_order_stats.total_sales’ in ‘field list’ for query \n\t\t\tSELECT\n\t\t\t\tSUM( CASE WHEN wp_wc_order_stats.parent_id = 0 THEN 1 ELSE 0 END ) as orders_count, ( SUM(wp_wc_order_stats.total_sales) + COALESCE( SUM(discount_amount), 0 ) – SUM(wp_wc_order_stats.tax_total) – SUM(wp_wc_order_stats.shipping_total) + ABS( SUM( CASE WHEN wp_wc_order_stats.net_total < 0 THEN wp_wc_order_stats.net_total ELSE 0 END ) ) ) as gross_sales, SUM(wp_wc_order_stats.total_sales) AS total_sales, ABS( SUM( CASE WHEN wp_wc_order_stats.net_total < 0 THEN wp_wc_order_stats.net_total ELSE 0 END ) ) AS refunds, COALESCE( SUM(discount_amount), 0 ) AS coupons, SUM(wp_wc_order_stats.tax_total) AS taxes, SUM(wp_wc_order_stats.shipping_total) AS shipping, SUM(wp_wc_order_stats.net_total) AS net_revenue , wcml_language_postmeta.meta_value AS language\n\t\t\tFROM\n\t\t\t\twp_wc_order_stats\n\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\torder_id,\n\t\t\t\t\t\t\tSUM(discount_amount) AS discount_amount,\n\t\t\t\t\t\t\t…PHP message: WordPress database error Unknown column ‘wp_wc_order_stats.total_sales’ in ‘field list’ for query \n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(wp_wc_order_stats.
date_created
, ‘%Y-%m-%d’) AS time_interval , MAX(wp_wc_order_stats.date_created) AS datetime_anchor , SUM( CASE WHEN wp_wc_order_stats.parent_id = 0 THEN 1 ELSE 0 END ) as orders_count, ( SUM(wp_wc_order_stats.total_sales) + COALESCE( SUM(discount_amount), 0 ) – SUM(wp_wc_order_stats.tax_total) – SUM(wp_wc_order_stats.shipping_total) + ABS( SUM( CASE WHEN wp_wc_order_stats.net_total < 0 THEN wp_wc_order_stats.net_total ELSE 0 END ) ) ) as gross_sales, SUM(wp_wc_order_stats.total_sales) AS total_sales, ABS( SUM( CASE WHEN wp_wc_order_stats.net_total < 0 THEN wp_wc_order_stats.net_total ELSE 0 END ) ) AS refunds, COALESCE( SUM(discount_amount), 0 ) AS coupons, SUM(wp_wc_order_stats.tax_total) AS taxes, SUM(wp_wc_order_stats.shipping_total) AS shipping, SUM(wp_wc_order_stats.net_total) AS net_revenue , wcml_language_postmeta.meta_value AS langua…’These errors appear when this referer is called: /wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2Frevenue&chart=net_revenue&orderby=net_revenue&period=month&compare=previous_period
I thought about a transient cache issue or something, but running the bellow did not fix it.
$ wp transient delete woocommerce_reports-transient-version
Any idea
The page I need help with: [log in to see the link]
- The topic ‘WordPress database error Unknown column ‘wp_wc_order_stats.total_sales’’ is closed to new replies.