From 56a1a302243829288ce06d6dd22c4f8db49125df Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Wed, 6 Feb 2019 19:15:06 -0800 Subject: [PATCH] Skip processing `shop_order_refund`s when syncing coupon and tax lookup tables. --- .../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, 2 insertions(+), 2 deletions(-) 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 b49915211f5..5d1338359e5 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,7 +319,7 @@ class WC_Admin_Reports_Coupons_Data_Store extends WC_Admin_Reports_Data_Store im global $wpdb; $order = wc_get_order( $order_id ); - if ( ! $order ) { + 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 eb6f934700f..0f613015546 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,7 +258,7 @@ 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 ); - if ( ! $order ) { + if ( ! $order || 'shop_order' !== $order->get_type() ) { return -1; }