Forum Replies Created

Viewing 1 replies (of 1 total)
  • So, I found a temporary solution (sort of). In class-wc-shortcode-checkout.php I commented lines 303 – 319. Those:

    		// For non-guest orders, require the user to be logged in before showing this page.
    		if ( $order_customer_id && get_current_user_id() !== $order_customer_id ) {
    			wc_print_notice( esc_html__( 'Please log in to your account to view this order.', 'woocommerce' ), 'notice' );
    			woocommerce_login_form( array( 'redirect' => $order->get_checkout_order_received_url() ) );
    			return;
    		}
    
    		// For guest orders, request they verify their email address (unless we can identify them via the active user session).
    		if ( self::guest_should_verify_email( $order, 'order-received' ) ) {
    			wc_get_template(
    				'checkout/form-verify-email.php',
    				array(
    					'failed_submission' => ! empty( $_POST['email'] ), // phpcs:ignore WordPress.Security.NonceVerification.Missing
    					'verify_url'        => $order->get_checkout_order_received_url(),
    				)
    			);
    			return;
    		}

    Those lines are responsible for non-guest users to get login page and for guest users the get email verify page. Once I commented them, the Thank You page functions as previously. Now, it’s a change in the core of the plugin, and as mentioned here before it will be overwritten in any update. That’s the only solution that worked for me. As I said, it’s tricky and not the safest solution so I am not taking any responsibility for that. I prefer not to change the core but this one worked out.

Viewing 1 replies (of 1 total)