From 300069234a24943dbaaab4567cb418582ad83aa1 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 7 Feb 2019 18:41:40 -0800 Subject: [PATCH] Add comments to explain we are skipping `shop_order_refund` types when syncing stats for coupons and taxes. --- .../data-stores/class-wc-admin-reports-coupons-data-store.php | 2 ++ .../data-stores/class-wc-admin-reports-taxes-data-store.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php index 5d1338359e5..29b4676c452 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php @@ -319,6 +319,8 @@ class WC_Admin_Reports_Coupons_Data_Store extends WC_Admin_Reports_Data_Store im global $wpdb; $order = wc_get_order( $order_id ); + + // Skip `shop_order_refunds` when factoring stats on coupon usage. if ( ! $order || 'shop_order' !== $order->get_type() ) { return -1; } diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php index 0f613015546..c8cf1658f22 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php @@ -258,6 +258,8 @@ class WC_Admin_Reports_Taxes_Data_Store extends WC_Admin_Reports_Data_Store impl public static function sync_order_taxes( $order_id ) { global $wpdb; $order = wc_get_order( $order_id ); + + // Skip `shop_order_refunds` when factoring stats on order tax. if ( ! $order || 'shop_order' !== $order->get_type() ) { return -1; }