Craft commerce 3 - Module - Lineitem - Get usergroup
Remembering a) that not all customers are users and b) that a user can be in one, or more, groups.....then something like this can be used to check if a user is in a particular group:
            $order = $lineItem-&gt;getOrder();
            $user = Craft::$app-&gt;users-&gt;getUserByUsernameOrEmail($order-&gt;email);
            if ($user){
                foreach ($user-&gt;getGroups() as $group) {
                    if ($group-&gt;id == someParticularValue){
                        //do stuff
                    }
                }
            }