/** * Sets the hooks required by the class. */ protected function set_hooks() { parent::set_hooks(); // Override entire reports add_filter('woocommerce_admin_reports', array($this, 'woocommerce_admin_reports'), 50); }
/** * Sets the hooks required by the class. */ protected function set_hooks() { parent::set_hooks(); // Sales Overview add_filter('woocommerce_reports_sales_overview_order_totals', array($this, 'woocommerce_reports_sales_overview_order_totals'), 50); add_filter('woocommerce_reports_sales_overview_discount_total', array($this, 'woocommerce_reports_sales_overview_discount_total'), 50); add_filter('woocommerce_reports_sales_overview_shipping_total', array($this, 'woocommerce_reports_sales_overview_shipping_total'), 50); // Daily Sales add_filter('woocommerce_reports_daily_sales_orders', array($this, 'woocommerce_reports_daily_sales_orders'), 50, 3); // Monthly Sales add_filter('woocommerce_reports_monthly_sales_orders', array($this, 'woocommerce_reports_monthly_sales_orders'), 50, 2); // Sales per Product add_filter('woocommerce_reports_product_sales_order_items', array($this, 'woocommerce_reports_product_sales_order_items'), 50, 2); // Top Earners add_filter('woocommerce_reports_top_earners_order_items', array($this, 'woocommerce_reports_top_earners_order_items'), 50, 3); // Sales by Category add_filter('woocommerce_reports_category_sales_order_items', array($this, 'woocommerce_reports_category_sales_order_items'), 50, 2); // Override entire reports add_filter('woocommerce_reports_charts', array($this, 'woocommerce_reports_charts'), 50); // TODO Override Monthly taxes report completely. Such function doesn't implement hooks that can be intercepted to recalculate the values. // Intercept hook "woocommerce_reports_charts" and set the following: //if (get_option('woocommerce_calc_taxes') == 'yes') { // $charts['sales']['charts']["taxes_by_month"] = array( // 'title' => __('Taxes by month', 'woocommerce'), // 'description' => '', // 'function' => <put new function here> // ); //} // Coupons Overview add_filter('woocommerce_reports_coupons_overview_totals', array($this, 'woocommerce_reports_coupons_overview_totals'), 50); // Coupons by Count and Amount add_filter('woocommerce_reports_coupons_overview_coupons_by_count', array($this, 'woocommerce_reports_coupons_overview_coupons_by_count'), 50); // Sales in which Coupons were used add_filter('woocommerce_reports_coupons_sales_used_coupons', array($this, 'woocommerce_reports_coupons_sales_used_coupons'), 50); // Customer Orders add_filter('woocommerce_reports_customer_overview_customer_orders', array($this, 'woocommerce_reports_customer_overview_customer_orders'), 50); // Guest Orders add_filter('woocommerce_reports_customer_overview_guest_orders', array($this, 'woocommerce_reports_customer_overview_guest_orders'), 50); }