Viewing 2 replies - 1 through 2 (of 2 total)
  • I need the same capability – did you ever get an answer to this. I need the bulk discount to not apply to wholesale users.

    Found this code to remove a plugin based on user role – but it is not working?

    add_action(‘admin_init’, ‘my_filter_the_plugins’);
    function my_filter_the_plugins()
    {
    global $current_user;
    if (in_array(‘wholesale_customer’, $current_user->roles)) {
    deactivate_plugins( // deactivate for wholesale_customer
    array(
    ‘/woocommerce-bulk-discount/woocommerce-bulk-discount.php’
    ),
    true, // silent mode (no deactivation hooks fired)
    false // network wide
    );
    } else { // activate for those than can use it
    activate_plugins(
    array(
    ‘/woocommerce-bulk-discount/woocommerce-bulk-discount.php’
    ),
    ”, // redirect url, does not matter (default is ”)
    false, // network wise
    true // silent mode (no activation hooks fired)
    );
    }
    }

    Suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bulk Discount for User Groups’ is closed to new replies.