This thread is resolved. Here is a description of the problem and solution.

Problem:

Solution: The cause of the problem is \WWLC_User_Account::registration_page_redirect_logged_in_user in wp-content/plugins/woocommerce-wholesale-lead-capture/includes/class-wwlc-user-account.php
There this code is responsible:

$registration_page = url_to_postid( wwlc_get_url_of_page_option( 'wwlc_general_registration_page' ) );

Mainly is the code for url_to_postid() function that we filter on lately
As a workaround change the code to:

public function registration_page_redirect_logged_in_user() {
 
            global $post;
 
            if ( ! is_user_logged_in() )
                return;
if (! is_admin()) {
    $registration_page = url_to_postid( wwlc_get_url_of_page_option( 'wwlc_general_registration_page' ) );
    $my_account_page   = get_option( 'woocommerce_myaccount_page_id' );
 
    if ( $registration_page && $my_account_page && is_object( $post ) && $registration_page === $post->ID && $registration_page != $my_account_page ) {
 
        wp_redirect( get_permalink( $my_account_page ), 302 );
        exit;
 
    }
}
 
        }

Relevant Documentation:

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 21 replies, has 2 voices.

Last updated by Carlos Rojas 4 months, 2 weeks ago.

Assigned support staff: Carlos Rojas.

Author Posts
September 4, 2019 at 9:08 am #4509557

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Hitesh,

I have escalated this ticket to our compatibility team where our compatibility specialists will take a deeper look at the issue and will try to find a solution.

I will get back to you as soon as I have an answer.

Regards,
Carlos

September 4, 2019 at 9:21 am #4509653

hiteshH

Hi Carlos,

Thank you for your update, Please let me know once the solution is known.

so I can implement the same on my live site :))

Regards
Hitesh

September 4, 2019 at 9:54 am #4509867

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Hitesh,

Yes, I will keep you updated about the evolution of this ticket.

Regards,
Carlos

September 6, 2019 at 10:22 pm #4527463

hiteshH

Hi,

Hope you are doing fine!

Any updates regarding this issue?

Regards
Hitesh

September 9, 2019 at 10:13 am #4535863

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Hitesh,
Thank you for checking.

Unfortunately I still have no answer, but I will write you as soon as I get an answer from our specialists.

Regard,
Carlos

November 15, 2019 at 1:44 pm #4954495

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi Hitesh,

The cause of the problem is \WWLC_User_Account::registration_page_redirect_logged_in_user in wp-content/plugins/woocommerce-wholesale-lead-capture/includes/class-wwlc-user-account.php
There this code is responsible:

$registration_page = url_to_postid( wwlc_get_url_of_page_option( 'wwlc_general_registration_page' ) );

Mainly is the code for url_to_postid() function that we filter on lately
As a workaround change the code to:

		public function registration_page_redirect_logged_in_user() {

			global $post;

			if ( ! is_user_logged_in() )
				return;
if (! is_admin()) {
	$registration_page = url_to_postid( wwlc_get_url_of_page_option( 'wwlc_general_registration_page' ) );
	$my_account_page   = get_option( 'woocommerce_myaccount_page_id' );

	if ( $registration_page && $my_account_page && is_object( $post ) && $registration_page === $post->ID && $registration_page != $my_account_page ) {

		wp_redirect( get_permalink( $my_account_page ), 302 );
		exit;

	}
}

		}

Could you confirm that the issue is solved?

Regards,
Carlos

November 18, 2019 at 12:35 am #4961419

hiteshH

My issue is resolved now. Thank you!

November 18, 2019 at 9:25 am #4963365

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

I'm glad to hear that the issue is solved 🙂

Please don't hesitate to contact us if you need our help in the future with WPML. We will be more than happy to help.
Best regards,
Carlos