Home Forums WoodMart support forum User role

User role

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #511538

    gianlucacontento
    Participant

    Hi,

    is it possible to disable/hide the display of the “Product settings (metabox customized by the theme)“, present at the bottom of the product pages in the backend for users with the Store Manager role?

    Thank you

    #511625

    Hello,

    Sorry to say but right now there is no option in Theme Settings available for that. It requires Customization and this is beyond our limitations and support policy scope. Hope you can understand our limitations.

    If you’d like to contact us, we are here for whatever questions you may have.

    Best Regards.

    #670997

    Maxor
    Participant

    Hi

    Sure, here it is :

    add_action( 'add_meta_boxes', 'prox_remove_woodmart_metabox_for_shop_manager', 99 );
    
    function prox_remove_woodmart_metabox_for_shop_manager() {
    	if ( current_user_can( 'shop_manager' ) && ! current_user_can( 'administrator' ) ) {
    		// Cible les types de contenus à adapter selon ton besoin
    		$post_types = array( 'post', 'page', 'product' );
    
    		foreach ( $post_types as $post_type ) {
    			remove_meta_box( 'xts_page_metaboxes', $post_type, 'side' );   // Si elle est dans la sidebar
    			remove_meta_box( 'xts_page_metaboxes', $post_type, 'normal' ); // Si elle est dans le bloc principal
    			remove_meta_box( 'xts_page_metaboxes', $post_type, 'advanced' ); // Si elle est dans la section avancée
                remove_meta_box( 'xts_product_metaboxes', $post_type, 'side' );   // Si elle est dans la sidebar
    			remove_meta_box( 'xts_product_metaboxes', $post_type, 'normal' ); // Si elle est dans le bloc principal
    			remove_meta_box( 'xts_product_metaboxes', $post_type, 'advanced' ); // Si elle est dans la section avancée
    		}
    	}
    }
    
    #671131

    Hello,

    @Maxor
    Thanks for sharing the solution—it’ll be helpful for others too.

    Best Regards,

Viewing 4 posts - 1 through 4 (of 4 total)