MultiVendor- Compatibility between storefront-powerpack and Yith Multi Vendors

To make the two plugins are compatible you should add this code in the functions.php of your theme:

 

if( is_admin() && class_exists( 'WooCommerce' ) && function_exists( 'YITH_Vendors' ) && function_exists( 'storefront_powerpack' ) ){
$user = wp_get_current_user();
if( $user instanceof WP_User && ! current_user_can( 'manage_woocommerce' ) && in_array( YITH_Vendors()->get_role_name(), $user->roles ) ){
remove_action( 'init', array( storefront_powerpack(), 'includes' ), 0 );
}
}
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk