I noticed that registering an account lead to the home page. This is unusual, because normally MarketKing leads to the "/my-account/?redir=1" link. This indicated to me it might be a plugin or theme conflict.
I switched the theme to the Twenty twenty one theme and tested a registration. I then saw the normal link:
Based on this, I believe there is some code in your theme that is forcing a Home page redirect, rather than our plugin's redirect (Which would also be why the redirect your custom page would not work).
I investigated the functions.php file further and I found the code causing the issue:
add_action('wp_logout','afield_redirect_after_logout');
function afield_redirect_after_logout(){ wp_safe_redirect( home_url() ); exit; }
Here's what happens: WooCommerce normally logs in a user after registering. In order for MarketKing to show the "thank you for registering...please wait to be approved" message, we need to technically log out the user - which is where the above code interferes and redirects to the home page.
Hello! Is there a way to change the redirect URL after vendor registration?
I want to redirect user to a custom page if he registered as vendor.
Hi there!
I can send you a code snippet for this.
Are you using manual approval for vendors, or automatic approval?
I ask because I think different code would be needed.
Kind regards,
Stefan
I am using manual approval. Thank you. Will wait for your code snippet.
Great, you can use this code snippet then:
You'd just need to change the URL to your own.
Hi Andrea,
I was able to look into this now.
I noticed that registering an account lead to the home page. This is unusual, because normally MarketKing leads to the "/my-account/?redir=1" link. This indicated to me it might be a plugin or theme conflict.
I switched the theme to the Twenty twenty one theme and tested a registration. I then saw the normal link:
Based on this, I believe there is some code in your theme that is forcing a Home page redirect, rather than our plugin's redirect (Which would also be why the redirect your custom page would not work).
I investigated the functions.php file further and I found the code causing the issue:
Here's what happens: WooCommerce normally logs in a user after registering. In order for MarketKing to show the "thank you for registering...please wait to be approved" message, we need to technically log out the user - which is where the above code interferes and redirects to the home page.
It would be needed to modify or remove that code.
Kind regards,
Stefan