From 3c2e3cc9aa8e3c2551e37bb77c4332ebde1797a9 Mon Sep 17 00:00:00 2001 From: Beka Rice Date: Wed, 10 Jul 2019 18:36:43 -0400 Subject: [PATCH] Only set paying customer prop when required --- includes/wc-user-functions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 81e6b124d55..2414c308f43 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -247,8 +247,11 @@ function wc_paying_customer( $order_id ) { if ( $customer_id > 0 && 'shop_order_refund' !== $order->get_type() ) { $customer = new WC_Customer( $customer_id ); - $customer->set_is_paying_customer( true ); - $customer->save(); + + if ( ! $customer->get_is_paying_customer() ) { + $customer->set_is_paying_customer( true ); + $customer->save(); + } } } add_action( 'woocommerce_payment_complete', 'wc_paying_customer' );