Hello @pis24,
You may need some custom codes to hide those menus from the vendor dashboard. Please add the below codes on your child-theme’s functions.php file-
add_filter( 'dokan_get_dashboard_nav', 'prefix_dokan_add_seller_nav',12 );
function prefix_dokan_add_seller_nav( $urls ) {
unset( $urls['coupons'],$urls['reviews'],$urls['orders'], $urls['reports'],$urls['withdraw'] );
return $urls;
}
add_filter( 'dokan_get_dashboard_settings_nav','wlrs_dashbaord_settings_nav',11);
function wlrs_dashbaord_settings_nav($sub_settins){
unset($sub_settins['payment']);
return $sub_settins;
}
Thread Starter
pis24
(@pis24)
Hi @nazmulhassann20, thanks for your reply. very much appreciated.
Unfortunately as I added the code, it broke the site. the site refused to laod. I could only see a blank white page. I’m using theshooper wordpres theme (child theme) and here is the code together with the above you gave me and it broke the site.
what do I do?
**********************************************************
<?php
function theme_enqueue_styles() {
wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’);
}
add_action( ‘theshopier_child_style’, ‘theme_enqueue_styles’, 99);
function theme_lang_setup() {
load_child_theme_textdomain( ‘theshopier-child’, get_stylesheet_directory() . ‘/languages’ );
}
add_action( ‘after_setup_theme’, ‘theme_lang_setup’ );
add_filter( ‘dokan_get_dashboard_nav’, ‘prefix_dokan_add_seller_nav’,12 );
function prefix_dokan_add_seller_nav( $urls ) {
unset( $urls[‘coupons’],$urls[‘reviews’],$urls[‘orders’], $urls[‘reports’],$urls[‘withdraw’] );
return $urls;
}
add_filter( ‘dokan_get_dashboard_settings_nav’,’wlrs_dashbaord_settings_nav’,11);
function wlrs_dashbaord_settings_nav($sub_settins){
unset($sub_settins[‘payment’]);
return $sub_settins;
}
Thread Starter
pis24
(@pis24)
@nazmulhassann20 I’ve found the solution here (a post you commented on) https://wedevs.com/support/topic/coupon-and-reviews-remove/#post-69393.
Thanks though for the reply.
Could you tell me how to make the default login redirect url point to products instead of the dashboard? That is after a user logs in, it should redirect to Products and not dashboard. Also when in the settings menu and the user clicks on return to dashboard, it should redirect or goto products.
Many thanks in advance.
Hi @pis24,
Add this snippet to your themes functions.php to redirect users to Shop page after login.
function pis24_after_login_redirect( $redirect_to, $user ){
return dokan_get_navigation_url('products');
}
add_filter( 'woocommerce_login_redirect', 'pis24_after_login_redirect' , 20, 2 );
And for the settings menu use this :
add_filter( 'dokan_get_dashboard_settings_nav','pis24_dashboard_settings_nav_custom' ,10 );
function pis24_dashboard_settings_nav_custom( $menu ){
$menu['back'] = array(
'title' => __( 'Back to Products', 'dokan-lite'),
'icon' => '<i class="fa fa-long-arrow-left"></i>',
'url' => dokan_get_navigation_url('products'),
'pos' => 10
);
return $menu;
}
Thanks
Thread Starter
pis24
(@pis24)
Hi @rafsuntaskin, thanks so much. it worked like a charm.