Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Redirect after vendor manager login
- This topic has 1 reply, 2 voices, and was last updated 4 years, 6 months ago by Sarmistha Chakraborty.
Viewing 1 reply thread
- AuthorPosts
- May 11, 2020 at 11:40 pm #129733dev.laditumParticipant
When a vendor manager logs in they are redirected to the WCFM page. Can I stop them from being redirected when on certain pages? I do not want them to be redirected when on a Woocommerce single product page.
- May 12, 2020 at 1:10 pm #129943Sarmistha ChakrabortyMember
Hello,
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
add_filter('wcfm_login_redirect','fn_wcfm_login_redirect_1205',10,2); function fn_wcfm_login_redirect_1205($redirect_to, $user) { if ( isset($user->roles) && is_array($user->roles) ) { if ( in_array( 'vendor', $user->roles ) ) { $redirect_to = '<your product page url>'; } elseif ( in_array( 'seller', $user->roles ) ) { $redirect_to = '<your product page url>'; } elseif ( in_array( 'wcfm_vendor', $user->roles ) ) { $redirect_to = '<your product page url>'; } elseif ( in_array( 'dc_vendor', $user->roles ) ) { $redirect_to = '<your product page url>'; } } return $redirect_to; }
Thanks.
- AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.