Today we talk about PrestaShop to get current user information. In this tutorial, we focus on how to get customer information. Grou name, group id, and other customer group related information.
You can get the context variable by following.
$groups = Group::getGroups(Context::getContext()->language->id);
foreach ($groups as $group) {
$idGroup = $group['id_group']; // get group id
$groupName = $group['name']; // get group name
}
foreach ($groups as $group) {
$idGroup = $group['id_group']; // get group id
$groupName = $group['name']; // get group name
}