Fix wc_paying_customer() refund check

wc_paying_customer() needs to check against 'shop_order_refund', which is
the actual return value of WC_Order_Refund::get_type(). No object will return
'refund', so a customer would always be declared as a paying customer even
for refund orders.
This commit is contained in:
Brent Shepherd 2017-01-19 11:16:43 -08:00
parent 9d513737ed
commit 3f338cd3e1
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ function wc_paying_customer( $order_id ) {
$order = wc_get_order( $order_id );
$customer_id = $order->get_customer_id();
if ( $customer_id > 0 && 'refund' !== $order->get_type() ) {
if ( $customer_id > 0 && 'shop_order_refund' !== $order->get_type() ) {
$customer = new WC_Customer( $customer_id );
$customer->set_is_paying_customer( true );
$customer->save();