Today we talk about WooCommerce or WordPress get the current user role. In this tutorial, We focus on getting the current user group for example you need to match or check what is current user role. On the basis of that need to give a discount or show some extra text.
Let’s start with our example.
$currentUser = wp_get_current_user();
$currentUserRole = $currentUser->roles;