• Resolved symapptest

    (@symapptest)


    Hello, I have WCFM plugin installed in our site. I created vendors. But I have noticed that vendors are redirected to their store manager page after login. But I want vendors to be redirected to /my-account page first like other users. I used woocommerce_login_redirect hook but did not work. Please suggest what can I do to do this?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WC Lovers

    (@wclovers)

    add_filter( 'wcfm_login_redirect', function( $redirect_to, $user ) {
    	if ( in_array( 'wcfm_vendor', $user->roles ) ) {
    		$redirect_to = get_permalink( wc_get_page_id( 'myaccount' ) );
    	}	
    	return $redirect_to;
    }, 50, 2 );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin – https://www.ads-software.com/plugins/code-snippets/

    Thread Starter symapptest

    (@symapptest)

    It’s working. Thanks very much.

    Thread Starter symapptest

    (@symapptest)

    Hello, it is working but when I open /wp-admin, an warning is showing: Warning: in_array() expects parameter 2 to be array, null given in /home/customer/www/autoplusperformance.com/public_html/wp-content/themes/wavo-child/functions.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to redirect to My Account page after login for vendors’ is closed to new replies.