Hi. How can we help?

How to disable "Edit Taxes" for vendors inside Frontend Manager dashboard

Add following code to the file functions.php of your theme if you want deny to your vendors to edit taxes for their products using Frontend manager dashboard.
 
if( !function_exists('yith_disable_tax_for_vendors_in_frontend_dashboard') ){
add_filter('wc_tax_enabled','yith_disable_tax_for_vendors_in_frontend_dashboard');


function yith_disable_tax_for_vendors_in_frontend_dashboard( $enabled ){

$user = wp_get_current_user();
if( in_array( 'yith_vendor',$user->roles ) && function_exists('YITH_Frontend_Manager') && isset(YITH_Frontend_Manager()->gui) && YITH_Frontend_Manager()->gui->get_current_section_obj() instanceof YITH_Frontend_Manager_Section_Products_Premium){
$enabled = false;
}

return $enabled;
}
}
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >

Powered by Zendesk