Remove dashboard/Redirect to all products

WCMp Vendor Frontend Reports

Remove dashboard/Redirect to all products Resolved

Viewing 4 reply threads
  • Author
    Posts
    • #106262
      randomdudeftw5
      Participant

      I do not need the dashboard and would like to remove it, I have already removed the nav on the left but I still get directed to the dashboard when I click on the vendors dashboard, is there a way I can remove this and redirect users to all products?

      Attachments:
    • #106318
      abhirup
      Moderator

      Hi,
      please add this code in the function.php of the current active theme :
      below code will redirect to the all product page after vendor login

      add_filter('login_redirect', 'wp_wcmp_vendor_login_redirect', 99, 3);
      add_filter('woocommerce_login_redirect', 'wcmp_vendor_login_redirect', 99, 2);
      function wp_wcmp_vendor_login_redirect($redirect_to, $requested_redirect_to, $user) {
         if(class_exists('WCMp')){
             if (isset($user->roles) && is_array($user->roles)) {
                 //check for vendor
                 if (in_array('dc_vendor', $user->roles)) {
                     $redirect_to = wcmp_get_vendor_dashboard_endpoint_url( get_wcmp_vendor_settings( 'wcmp_products_endpoint', 'vendor', 'general', 'products' ) ) ;
                 }
             }
         }
         return $redirect_to;
      }
      function wcmp_vendor_login_redirect($redirect_to, $user){
         if(class_exists('WCMp')){
             if (isset($user->roles) && is_array($user->roles)) {
                 //check for vendor
                 if (in_array('dc_vendor', $user->roles)) {   
                     $redirect_to = wcmp_get_vendor_dashboard_endpoint_url( get_wcmp_vendor_settings( 'wcmp_products_endpoint', 'vendor', 'general', 'products' ) );
                 }
             }
         }
         return $redirect_to;
      }
      Copy
    • #106323
      randomdudeftw5
      Participant

      Currently, I am use BuddyPress to login therefore this does not work, is there any way for me to go to the all products page when I click the dashboard(see picture).

      Attachments:
    • #106337
      randomdudeftw5
      Participant

      Thanks for the reply, the issue has been resolved. I just had to input a custom menu link to do so. You can close the thread now

    • #106428
      WCMp Support
      Keymaster

      Thank you!

Viewing 4 reply threads

The topic ‘Remove dashboard/Redirect to all products’ is closed to new replies.

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price