• Resolved Masoud NKH

    (@masoudnkh)


    HI friends,
    if vendor go to “Dashboard > Products > Add new product” can only use preset tags. But if vendor go to
    “/wp-admin/post-new.php?post_type=product” for add product, can add new product tag.
    Please fix this issue so that the seller cant create a new tag from anywhere

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @masoudnkh ,

    The ability to add tags to vendors is given on the Dokan Pro. Is there any particular reason to allow vendors to edit products from the wp-admin side? If not, then you can disable their access from Dokan > Settings > General – https://prnt.sc/10fmbjq.

    Alternatively, you can add this code in your theme’s functions.php file to remove the tag field from the product edit area when you are in the seller account –

    add_action( 'add_meta_boxes_product', 'remove_metaboxes_edit_product', 9999 );
     
    function remove_metaboxes_edit_product() {
     	$user = wp_get_current_user();
    	if ( in_array( 'seller', (array) $user->roles ) ) {
    		// e.g. remove product tags
            remove_meta_box( 'tagsdiv-product_tag', 'product', 'side' );
    	} 
    }

    I hope this helps.

    Thank you ??

    Thread Starter Masoud NKH

    (@masoudnkh)

    No No,
    Sorry, I could not convey my problem to you properly ??
    i not want to remove product tag metabox,
    I want show adminbar and wordpress dashboard for vendor to more control. but the problem is for way to add product.
    If add product from Dokan doashboard, all that ok, But when vendor go to wordpress dashboard and click on “Add new prouct” form woocommerce menu, in the tag field can add custom product.

    Hello @masoudnkh ,

    Okay, I get your idea.

    The closest solution that I can suggest is to hide the new tag adding an input field from the admin area. For that, you can add this code in your theme’s fucntions.php file –

    add_action('admin_head', 'hide_add_new_tag');
    
    function hide_add_new_tag() {
    	$user = wp_get_current_user();
    	if ( in_array( 'seller', (array) $user->roles ) ) {
    		echo '<style>
    				div#product_tag {
    					display: none;
    				}
    			  </style>';
    	} 
    }

    Thank you ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘problem with product tag’ is closed to new replies.