From dec89a13111f5c8cf2bc6864677b63453bc0ef35 Mon Sep 17 00:00:00 2001 From: Seghir Nadir Date: Fri, 30 Aug 2024 18:24:53 +0100 Subject: [PATCH] Revert "Store API: Do not resume orders with `pending` status (#50531)" (#51067) * Revert "Store API: Do not resume orders with `pending` status (#50531)" This reverts commit 3170acd1b0d15338e14079e464d1eabf64096751. * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- plugins/woocommerce/changelog/51067-revert-50531 | 4 ++++ .../woocommerce/src/StoreApi/Utilities/DraftOrderTrait.php | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/51067-revert-50531 diff --git a/plugins/woocommerce/changelog/51067-revert-50531 b/plugins/woocommerce/changelog/51067-revert-50531 new file mode 100644 index 00000000000..e65258f8afe --- /dev/null +++ b/plugins/woocommerce/changelog/51067-revert-50531 @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak +Comment: This reverts an existing PR. + diff --git a/plugins/woocommerce/src/StoreApi/Utilities/DraftOrderTrait.php b/plugins/woocommerce/src/StoreApi/Utilities/DraftOrderTrait.php index 4e80f2695f8..dedc60ae418 100644 --- a/plugins/woocommerce/src/StoreApi/Utilities/DraftOrderTrait.php +++ b/plugins/woocommerce/src/StoreApi/Utilities/DraftOrderTrait.php @@ -60,9 +60,8 @@ trait DraftOrderTrait { return true; } - // Failed orders and those needing payment can be retried if the cart hasn't changed. - // Pending orders are excluded from this check since they may be awaiting an update from the payment processor. - if ( $order_object->needs_payment() && ! $order_object->has_status( 'pending' ) && $order_object->has_cart_hash( wc()->cart->get_cart_hash() ) ) { + // Pending and failed orders can be retried if the cart hasn't changed. + if ( $order_object->needs_payment() && $order_object->has_cart_hash( wc()->cart->get_cart_hash() ) ) { return true; }