Home Forums WC Vendors Pro Support Adjust permissions/Role

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #64629
    Ilja Becker
    Participant

    Hello everybody,
    I use WC-Vendors Pro with Buddyboss Marketplace. Currently local in a dev system.
    Is there a possibility to adjust the permissions that is a differentiated between products,
    which are to be sold and products which are not to be sold.

    (Which is the template, i need to customize)
    1. User go to Vendor Application to register as a (Vendor or Exhibitor)
    –> Vendor (Sell Product)
    –> Exhibitor (no sell Product (only Show))

    2. User is now in Permissions status (Pending)

    (i need to customize)
    3. Now I can choose which permissions the user gets
    –> The default “Vendor” Role
    –> Role: “Exhibitor” In Dashboard only Products, Rating, Setting visible
    —–>In Product/Add Product: Product Type, SKU, Regular Price, Sale Price not visible
    —–>In Settings: user can register as a Vendor

    #64736
    Anna
    Member

    @bigbensnake
    This would need to be custom coded for your site. We give the vendor permission to create and edit products; you’d have to alter the roles and/or create a new role to only allow certain capabilities- and I am not even sure which wp capabilities this would be.
    Could you try out the shop manager role (woocommerce role) and see if that meets the needs for your Exhibitor? You might be able to use that role for the permissions you are describing…

    #64875
    Ilja Becker
    Participant

    Hey Anna,
    I have found a solution for me, which should work very well.
    i create on functions.php in oneSocial-Child a new function whitch grab a other css File based on the created Role “Exhibitor”. This works very good. Now I can Hide the Forms i don´t need for the Role Exhibitor.

    In need current only 2 things.

    1. Can you tell me where I find the php file, which controls the access to the dashboard
    Current only user with role “vendor” have access to Dashboard. I need to customize the file that the new Role have Access too.

    2. Which is the template for the Vendor Application?

    #65083
    Ilja Becker
    Participant

    I find the Signup Form for the Vendor Application.

    Need only to know where are the php file, which controls the access to the dashboard
    Current only user with role “vendor” have access to Dashboard. I need to customize the file that the new Role have Access too.

    #65499
    Ilja Becker
    Participant

    Has nobody a answer on this simple question?

    #65591
    Anna
    Member

    @bigbensnake
    This may be what you need..
    wp-content/plugins/wc-vendors-pro/public/class-wcvendors-pro-dashboard.php
    lines 463-496:

    /**
    	 * Can the current user view the dashboard ? 
    	 *
    	 * @since    1.0.0
    	 */
    	public function can_view_dashboard() { 
    
    		if ( !is_user_logged_in() ) {
    			return false;
    		} else if ( !WCV_Vendors::is_vendor( get_current_user_id() ) ) {
    			// Include the dashboard wrapper 
    			include_once( apply_filters( 'wcvendors_pro_dashboard_open_path', 'partials/wcvendors-pro-dashboard-open.php' ) ); 
    
    			if ( WCVendors_Pro_Vendor_Controller::is_pending_vendor( get_current_user_id() ) ) { 
    				$vendor_pending_notice = WCVendors_Pro::get_option( 'vendor_pending_notice' );
    				wc_get_template( 'vendor-pending-notice.php', array( 'vendor_pending_notice' => $vendor_pending_notice ), 'wc-vendors/front/', $this->base_dir . '/templates/front/' );
    				return false; 
    			} elseif ( !current_user_can('administrator') ) { 
    				$vendor_signup_notice = WCVendors_Pro::get_option( 'vendor_signup_notice' );
    				// Load the new sign up form template 
    				wc_get_template( 'vendor-signup-form.php', array( 'vendor_signup_notice' => $vendor_signup_notice ), 'wc-vendors/front/', $this->base_dir . '/templates/front/' );
    				return false; 
    			} else { 
    				echo __( 'Admins cannot apply to be vendors. ', 'wcvendors-pro' ); 
    				return false;  
    			}
    
    			// Close the dashboard wrapper
    			include_once( apply_filters( 'wcvendors_pro_dashboard_close_path', 'partials/wcvendors-pro-dashboard-close.php' ) ); 
    		}
    
    		return true;
    
    	} // can_view_dashboard()
    #65691
    Ilja Becker
    Participant

    thanks,
    that’s what i’m searching 🙂

    #66122
    Ilja Becker
    Participant

    @FERVOUS
    i custom it and it Works great.
    But i see that i need to custom another 2 permissions.

    1. Backend Products i see only User with “Vendor” Role (screenshot “Vendor_assignment”)
    –> I need to customize the file that the new Role have Access too
    2. upload Product Pictures i see all Pictures in Media library (screenshot “Media library”)
    –> I need to customize the file that the new Role haven’t Access

    can you tell me the files 🙂

    #68570
    Ilja Becker
    Participant

    Has nobody a answer on this question?

    #69228
    Ilja Becker
    Participant

    ?

    #69962
    Ilja Becker
    Participant

    I have found it myself. If someone have interest:

    1. File: \plugins\wc-vendors\classes\admin\class-product-meta.php (Line: 101)

    2. Ad following Code in functions.php

    function portrait_show_curr_user_attachments( $query = array() ) {
        $user_id = get_current_user_id();
     
        if ( $user_id && ! current_user_can( 'edit_others_portraits' ) ) {
            $query['author'] = $user_id;
        }
     
        return $query;
    }
    add_filter( 'ajax_query_attachments_args', 'portrait_show_curr_user_attachments' );
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.