Add comments to explain we are skipping `shop_order_refund` types when syncing stats for coupons and taxes.
This commit is contained in:
parent
28739b7cf7
commit
300069234a
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue