Multi Vendor - Remove Essential Grid and Tab inventory from edit product

If you want remove Essential Grid and Tab inventory from edit product you could with this provided code.

Insert this in  functions.php in your theme:

 

_____________________________________________________________________

 

if( function_exists( 'YITH_Vendors' ) ){
function yith_wcmv_remove_ess_grid_metabox(){
$vendor = yith_get_vendor( 'current', 'user' );
if( $vendor->is_valid() && $vendor->has_limited_access() ){
remove_meta_box( 'eg-meta-box', 'product', 'normal' );
}
}

function yith_wcmv_add_product_customizzation( $product_data_tabs ){
$vendor = yith_get_vendor( 'current', 'user' );
if( $vendor->is_valid() && $vendor->has_limited_access() ){
$to_removes = array( 'inventory', 'advanced', 'linked_product' );
foreach( $to_removes as $to_remove ){
if( isset( $product_data_tabs[ $to_remove ] ) ){
unset( $product_data_tabs[ $to_remove ] );
}
}
}
return $product_data_tabs;
}

add_filter( 'woocommerce_product_data_tabs', 'yith_wcmv_add_product_customizzation' );

if( class_exists( 'Essential_Grid_Admin' ) ) {
add_action( 'add_meta_boxes', 'yith_wcmv_remove_ess_grid_metabox', 20 );
}
}

_____________________________________________________________________

Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk