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; }