Only set paying customer prop when required
This commit is contained in:
parent
0e1a926721
commit
3c2e3cc9aa
|
@ -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' );
|
||||
|
|
Loading…
Reference in New Issue