Disable order owner check for payment if guest checkout is enabled as per #4957

This commit is contained in:
Gerhard 2014-02-26 11:57:28 +02:00 committed by Coen Jacobs
parent 17cc7d7c1a
commit ca3b143b36
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class WC_Shortcode_Checkout {
$order = new WC_Order( $order_id ); $order = new WC_Order( $order_id );
$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ); $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 '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>'; echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
return; return;
} }