Support » Plugin: Waitlist Woocommerce ( Back in stock notifier ) » Good Plugin … AMAZING assistance

  • The Shop Manager does not have the ability to administer the Waitlist plugin.
    EDIT
    SUPER assistance from the plugin creator.
    He solved the problem and updated the plugin

    • This topic was modified 2 weeks, 5 days ago by sinocaweb.
    • This topic was modified 2 weeks, 5 days ago by sinocaweb. Reason: solved the problem
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author xootix

    (@xootix)

    @sinocaweb

    Have you tried opening a support ticket on wordpress.org?
    I just tested with Shop Manager role, works fine on my side.
    Have you edited any capabilities for shop manager?

    No, I haven’t changed anything, but I’ve noticed that the shop manager doesn’t have the ability to see the waitlist plugin
    Then I also tried to modify via function.php to get the shop manager permissions, but I don’t know the associated “cap”
    add_cap (‘shop_manager’ ‘… ??? ….‘);

    Plugin Author xootix

    (@xootix)

    Two ways to adjust this.
    Add one of the two below codes to your functions.php which suits best to you.

    1)

    //Adds manage_options capability to shop_manager
    add_action( 'admin_init', function() {
    	$role = get_role( 'shop_manager' );
    	if( '' != $role ) {
    		$role->add_cap( 'manage_options' );
    	}
    });

    2)

    //Changes plugin capability to shop_manager
    add_action( 'admin_menu', function(){
    
    	if( !function_exists( 'xoo_wl' ) ) return;
    
    	remove_menu_page( 'xoo-wl' );
    	remove_submenu_page( 'xoo-wl','xoo-wl' );
    	remove_submenu_page( 'xoo-wl','xoo-wl-view-waitlist' );
    	remove_submenu_page( 'xoo-wl','xoo-wl-email-history' );
    	remove_submenu_page( 'xoo-wl','xoo-wl-fields' );
    
    	add_menu_page( 
    		'Waitlist Settings', //Page Title
    		'Waitlist', // Menu Titlle
    		'manage_woocommerce',// capability
    		'xoo-wl', // Menu Slug
    		null,
    		null
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Settings',
    		'Settings',
    		'manage_woocommerce',
    		'xoo-wl',
    		array( xoo_wl_admin_settings(), 'menu_page_callback' )
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Users',
    		'Users',
    		'manage_woocommerce',
    		'xoo-wl-view-waitlist',
    		array( xoo_wl_admin_settings(), 'view_waitlist_page' )
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Email History',
    		'Email History',
    		'manage_woocommerce',
    		'xoo-wl-email-history',
    		array( xoo_wl_admin_settings(), 'view_email_history_page' )
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Form Fields',
    		'Form Fields',
    		'manage_woocommerce',
    		'xoo-wl-fields',
    		array( xoo_wl_admin_settings(), 'admin_fields_page' )
    	);
    
    }, 15 );
    • This reply was modified 3 weeks, 4 days ago by xootix.

    Thank you very much for your availability

    1) I avoided the first one because it showed the shop_manager everything

    2) the second is interesting, the icon appears, but if the shop_manager clicks on it, he says that “You are not allowed to access this page.”

    Plugin Author xootix

    (@xootix)

    Hello @sinocaweb

    Try replacing it with this

    add_action( 'admin_menu', function(){
    
    	global $menu, $submenu;
    
    	if( !function_exists( 'xoo_wl' ) || !current_user_can('manage_woocommerce') ) return;
    
    	remove_menu_page( 'xoo-wl' );
    	remove_submenu_page( 'xoo-wl','xoo-wl' );
    	remove_submenu_page( 'xoo-wl','xoo-wl-view-waitlist' );
    	remove_submenu_page( 'xoo-wl','xoo-wl-email-history' );
    	remove_submenu_page( 'xoo-wl','xoo-wl-fields' );
    
    	unset($GLOBALS['_wp_submenu_nopriv']['xoo-wl']);
    
    	add_menu_page( 
    		'Waitlist Settings', //Page Title
    		'Waitlist', // Menu Titlle
    		'manage_woocommerce',// capability
    		'xoo-wl', // Menu Slug
    		null,
    		null
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Settings',
    		'Settings',
    		'manage_woocommerce',
    		'xoo-wl',
    		array( xoo_wl_admin_settings(), 'menu_page_callback' )
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Users',
    		'Users',
    		'manage_woocommerce',
    		'xoo-wl-view-waitlist',
    		array( xoo_wl_admin_settings(), 'view_waitlist_page' )
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Email History',
    		'Email History',
    		'manage_woocommerce',
    		'xoo-wl-email-history',
    		array( xoo_wl_admin_settings(), 'view_email_history_page' )
    	);
    
    	add_submenu_page(
    		'xoo-wl',
    		'Form Fields',
    		'Form Fields',
    		'manage_woocommerce',
    		'xoo-wl-fields',
    		array( xoo_wl_admin_settings(), 'admin_fields_page' )
    	);
    
    }, 15 );
    Plugin Author xootix

    (@xootix)

    Hi @sinocaweb

    Do you mind updating your review if your query is resolved?

    No, it was not resolved, because in this way the shop_manager sees everything as the admin (theme, other plugin,ecc…). 🙁

    Plugin Author xootix

    (@xootix)

    I have updated the plugin.
    Change the capability to shop manager.
    You can remove all the custom code provided above.

    Amazing!
    Now it’s fine!
    6 stars for you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this review.