Woocommerce version 3 force login to pay orders


Woocommerce Version 3 now requires customers to LOGIN to pay orders.

If you want to disable this:

Go to the file:

/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php

and comment out line #97 to 108

// Logged out customer does not have permission to pay for this order.
} elseif ( ! current_user_can( 'pay_for_order', $order_id ) && ! is_user_logged_in() ) {
echo '
' . __( 'Please log in to your account below to continue to the payment form.', 'woocommerce' ) . '
';
woocommerce_login_form( array(
'redirect' => $order->get_checkout_payment_url(),
) );
return;

// Logged in customer trying to pay for someone else's order.
} elseif ( ! current_user_can( 'pay_for_order', $order_id ) ) {
wc_add_notice( __( 'This order cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), 'error' );