From ca3b143b369684065acd73c2d56e3624069e5935 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Wed, 26 Feb 2014 11:57:28 +0200 Subject: [PATCH] Disable order owner check for payment if guest checkout is enabled as per #4957 --- includes/shortcodes/class-wc-shortcode-checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/shortcodes/class-wc-shortcode-checkout.php b/includes/shortcodes/class-wc-shortcode-checkout.php index a3d5a5bd759..19b0a1a14d5 100644 --- a/includes/shortcodes/class-wc-shortcode-checkout.php +++ b/includes/shortcodes/class-wc-shortcode-checkout.php @@ -82,7 +82,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 ) && 'no' == get_option( 'woocommerce_enable_guest_checkout' ) ) { echo '
' . __( 'Invalid order.', 'woocommerce' ) . ' ' . __( 'My Account', 'woocommerce' ) . '' . '
'; return; }