Comments 1Sander started the conversationDecember 11, 2024 at 11:17amHow To Change the Redirection Page After Login? 2,619WebWizards repliedDecember 11, 2024 at 7:06pmHi there, You can specify a login redirection page using this code snippet: add_filter( 'woocommerce_login_redirect', 'custom_login_redirect', 1000000, 2 ); function custom_login_redirect( $redirect, $user ) { $is_b2b = get_user_meta($user->ID, 'b2bking_b2buser', true); if ( $is_b2b === 'yes' ){ $redirect = '/page1'; // B2B page here } else { $redirect = '/page2'; // B2C page here } return $redirect; } This sets a different page for b2b and b2c if you need. If not, you can set both to the same page. This code snippet can be added to functions.php or to any code snippets plugin. Kind regards, Stefan Sign in to reply ...
How To Change the Redirection Page After Login?
Hi there,
You can specify a login redirection page using this code snippet:
add_filter( 'woocommerce_login_redirect', 'custom_login_redirect', 1000000, 2 ); function custom_login_redirect( $redirect, $user ) { $is_b2b = get_user_meta($user->ID, 'b2bking_b2buser', true); if ( $is_b2b === 'yes' ){ $redirect = '/page1'; // B2B page here } else { $redirect = '/page2'; // B2C page here } return $redirect; }This sets a different page for b2b and b2c if you need. If not, you can set both to the same page.
This code snippet can be added to functions.php or to any code snippets plugin.
Kind regards,
Stefan