diff --git a/admin/woocommerce-admin-reports.php b/admin/woocommerce-admin-reports.php index 7c9a07a6cb3..0c2bfcd62b0 100644 --- a/admin/woocommerce-admin-reports.php +++ b/admin/woocommerce-admin-reports.php @@ -286,7 +286,7 @@ function woocommerce_sales_overview() { $total_sales = $total_orders = $order_items = $discount_total = $shipping_total = 0; - $order_totals = $wpdb->get_row( " + $order_totals = apply_filters('woocommerce_sales_overview_total_orders', $wpdb->get_row( " SELECT SUM(meta.meta_value) AS total_sales, COUNT(posts.ID) AS total_orders FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id @@ -299,12 +299,12 @@ function woocommerce_sales_overview() { AND posts.post_status = 'publish' AND tax.taxonomy = 'shop_order_status' AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "') - " ); + " ) ); $total_sales = $order_totals->total_sales; $total_orders = absint( $order_totals->total_orders ); - $discount_total = $wpdb->get_var( " + $discount_total = apply_filters('woocommerce_sales_overview_discount', $wpdb->get_var( " SELECT SUM(meta.meta_value) AS total_sales FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id @@ -317,9 +317,9 @@ function woocommerce_sales_overview() { AND posts.post_status = 'publish' AND tax.taxonomy = 'shop_order_status' AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "') - " ); + " ) ); - $shipping_total = $wpdb->get_var( " + $shipping_total = apply_filters('woocommerce_sales_overview_shipping', $wpdb->get_var( " SELECT SUM(meta.meta_value) AS total_sales FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id @@ -332,9 +332,9 @@ function woocommerce_sales_overview() { AND posts.post_status = 'publish' AND tax.taxonomy = 'shop_order_status' AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "') - " ); + " ) ); - $order_items = absint( $wpdb->get_var( " + $order_items = apply_filters('woocommerce_sales_overview_order_items', absint( $wpdb->get_var( " SELECT SUM( order_item_meta.meta_value ) FROM {$wpdb->prefix}woocommerce_order_items as order_items LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id @@ -347,7 +347,7 @@ function woocommerce_sales_overview() { AND tax.taxonomy = 'shop_order_status' AND order_items.order_item_type = 'line_item' AND order_item_meta.meta_key = '_qty' - " ) ); + " ) ) ); ?>