Add comments to explain we are skipping `shop_order_refund` types when syncing stats for coupons and taxes.

This commit is contained in:
Jeff Stieler 2019-02-07 18:41:40 -08:00
parent 28739b7cf7
commit 300069234a
2 changed files with 4 additions and 0 deletions

View File

@ -319,6 +319,8 @@ class WC_Admin_Reports_Coupons_Data_Store extends WC_Admin_Reports_Data_Store im
global $wpdb; global $wpdb;
$order = wc_get_order( $order_id ); $order = wc_get_order( $order_id );
// Skip `shop_order_refunds` when factoring stats on coupon usage.
if ( ! $order || 'shop_order' !== $order->get_type() ) { if ( ! $order || 'shop_order' !== $order->get_type() ) {
return -1; return -1;
} }

View File

@ -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 ) { public static function sync_order_taxes( $order_id ) {
global $wpdb; global $wpdb;
$order = wc_get_order( $order_id ); $order = wc_get_order( $order_id );
// Skip `shop_order_refunds` when factoring stats on order tax.
if ( ! $order || 'shop_order' !== $order->get_type() ) { if ( ! $order || 'shop_order' !== $order->get_type() ) {
return -1; return -1;
} }