Best Multi Vendor Marketplace Plugin for WordPress › Forums › WCFM › Vendors Registration
- This topic has 6 replies, 2 voices, and was last updated 7 years, 11 months ago by
WCFM Forum.
- AuthorPosts
- July 31, 2018 at 10:09 am #27349
Alice
GuestHey,
When someone registers on my site to become a vendor, the first page it directs them to is WCMP which displays the wrong dashboard.
For the time being, I’ve set up a redirect so if someone goes to the page /wcmp they get redirected to /wcfm which does the job, but I wanted to check if there was a better way I should be doing this?
Thanks!
- July 31, 2018 at 10:10 am #27350
Alice
GuestThis reply has been marked as private. - July 31, 2018 at 10:21 am #27352
WCFM Forum
MemberHi,
Are you using WC Marketplace default registration form for vendor registration?
Actually, WCfM core already has this function to redirect vendors from WC Marketplace dashboard to WCfM Dashboard.
I don’t think any additional code required for this.Between, any chance do you have used “wcfm_is_allow_multivendor_dashboard_redirect” filter anywhere in your custom codes?
Thank You
- July 31, 2018 at 11:03 am #27354
Alice
GuestI’m not sure to be honest – I assume I’m using the default registration.
I seem to have the following code in my snippets, I don’t remember adding it though haha – should I remove it?
add_filter( ‘wcfm_is_allow_multivendor_dashboard_redirect’, ‘__return_false’ );
function wcfm_dashbord_template_redirect() {
global $WCFM;if( is_user_logged_in() && is_vendor_dashboard() ) {
$user = wp_get_current_user();
$allowed_roles = apply_filters( ‘wcfm_allwoed_user_rols’, array( ‘administrator’, ‘shop_manager’ ) );
if ( array_intersect( $allowed_roles, (array) $user->roles ) ) {
wp_safe_redirect( get_wcfm_url() );
exit();
}
}
}
add_action( ‘template_redirect’, ‘wcfm_dashbord_template_redirect’, 600 ); - August 1, 2018 at 6:09 am #27384
WCFM Forum
MemberHi,
Please disable all these codes and take a look.
Problematic code – add_filter( ‘wcfm_is_allow_multivendor_dashboard_redirect’, ‘__return_false’ );
And for this you have to add redirect rule again, but it’s already there in WCfM.
Thank You
- August 1, 2018 at 7:52 am #27399
Alice
Guestperfect thank you!
- August 1, 2018 at 8:40 am #27400
WCFM Forum
MemberYou are welcome 🙂
- AuthorPosts
- The topic ‘Vendors Registration’ is closed to new replies.