Public Ticket #3622639 How to Change Redirect to Homepage Instead of /shop After Sub-Account Login Closed
Comments 2Dario started the conversationApril 6, 2024 at 8:38amHello,Currently, after sub-account login from the main account, users are redirected to the /shop page. I would like to modify this so that users are instead redirected to the homepage. Could you provide guidance on how to implement this change?Best regards. 2,619WebWizards repliedApril 7, 2024 at 4:40amHello Dario, To make that redirect to the homepage, please add this PHP code snippet to your site: add_filter('b2bkingking_login_subaccount_link', function($url){ return get_home_url(); }, 10, 1); This snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/ Kind regards, Stefan 2Dario repliedApril 8, 2024 at 9:00pmThanks for solving this. Kind regards.1 Like 2Dario repliedJune 6, 2024 at 10:45amI would also like to ask for the code that redirects to the homepage when a SalesKing agent logs into a customer's account. 2,619WebWizards repliedJune 7, 2024 at 3:37pmCertainly, you can use the following code snippet for that: add_filter('salesking_shop_as_customer_link', function($url){ return get_home_url(); }, 10, 1); It should redirect agents to the home page, after they click on 'shop as customer'. Sign in to reply ...
Hello,
Currently, after sub-account login from the main account, users are redirected to the /shop page. I would like to modify this so that users are instead redirected to the homepage.
Could you provide guidance on how to implement this change?
Best regards.
Hello Dario,
To make that redirect to the homepage, please add this PHP code snippet to your site:
add_filter('b2bkingking_login_subaccount_link', function($url){ return get_home_url(); }, 10, 1);This snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
Kind regards,
Stefan
Thanks for solving this.
Kind regards.
I would also like to ask for the code that redirects to the homepage when a SalesKing agent logs into a customer's account.
Certainly, you can use the following code snippet for that:
add_filter('salesking_shop_as_customer_link', function($url){ return get_home_url(); }, 10, 1);It should redirect agents to the home page, after they click on 'shop as customer'.