From a9f6f7fdfe4f6c32f0572980f6e2696917fcfbe7 Mon Sep 17 00:00:00 2001 From: Max Rice Date: Fri, 10 Jul 2015 19:51:02 -0400 Subject: [PATCH] Introduce woocommerce_order_full_refunded_status filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In certain situations it’s undesirable to automatically change the order status for an order that has been fully refunded. For example, an order processed with a credit card whose charge has been authorized but not yet captured is typically voided, not refunded since no funds have actually been transferred. In that case, it’s ideal to allow gateways to change the status to cancelled instead. --- includes/class-wc-ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 2659bd4a2f0..296db173c3f 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -2211,7 +2211,7 @@ class WC_AJAX { } if ( $refund_amount == $max_refund ) { - $order->update_status( 'refunded' ); + $order->update_status( apply_filters( 'woocommerce_order_fully_refunded_status', 'refunded', $order_id, $refund->id ) ); $response_data['status'] = 'fully_refunded'; }