From fce70b288d88e18f7920badf3e08f4e6b213ea3a Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 26 Sep 2013 17:18:12 +0100 Subject: [PATCH] We should allow failed orders to be resumed, not show a blank page. Closes #3612 @coenjacobs might need to go in 15 --- includes/shortcodes/class-wc-shortcode-checkout.php | 2 +- includes/wc-cart-functions.php | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/includes/shortcodes/class-wc-shortcode-checkout.php b/includes/shortcodes/class-wc-shortcode-checkout.php index e964b5b1d0e..72121d5484a 100644 --- a/includes/shortcodes/class-wc-shortcode-checkout.php +++ b/includes/shortcodes/class-wc-shortcode-checkout.php @@ -83,7 +83,7 @@ class WC_Shortcode_Checkout { $order = new WC_Order( $order_id ); $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ); - if ( !current_user_can( 'pay_for_order', $order_id ) ) { + if ( ! current_user_can( 'pay_for_order', $order_id ) ) { echo '
' . __( 'Invalid order.', 'woocommerce' ) . ' '. __( 'My Account →', 'woocommerce' ) .'' . '
'; return; } diff --git a/includes/wc-cart-functions.php b/includes/wc-cart-functions.php index 6e35cd16e0d..67d2f731d61 100644 --- a/includes/wc-cart-functions.php +++ b/includes/wc-cart-functions.php @@ -136,10 +136,6 @@ function woocommerce_clear_cart_after_payment() { $order = new WC_Order( $woocommerce->session->order_awaiting_payment ); if ( $order->id > 0 ) { - // If the order has failed, and the customer is logged in, they can try again from their account page - if ( $order->status == 'failed' && is_user_logged_in() ) - $woocommerce->cart->empty_cart(); - // If the order has not failed, or is not pending, the order must have gone through if ( $order->status != 'failed' && $order->status != 'pending' ) $woocommerce->cart->empty_cart();