Anyway, I think it may be little smarter to just create small function that generates label based on membership in user group... so if you are member of Gold group, you get in label "Gold" instead of Basic/Pro/VIP...
Add to business profile functions.php
// GENERATE USER LABEL
// Supports rewrite by Osclass Pay
// $user_id - osclass user id
function bpr_user_label($seller) {
if(!isset($seller['pk_i_id'])) {
return false;
}
$html = '<div class="bpr-user-type bpr-type-' . $seller['i_type'] . '">';
$html .= bpr_user_type($seller['i_type']);
$html .= '</div>';
$html = osc_apply_filter('bpr_user_label', $html, $seller['fk_i_user_id'], $seller);
return $html;
}
in plugin files (ie block.php) replace:
<div class="bpr-user-type bpr-type-<?php echo $seller['i_type']; ?>">
<?php echo bpr_user_type($seller['i_type']); ?>
</div>
with:
<?php echo bpr_user_label($seller); ?>
In osclass pay functions.php add these:
// GET USER GROUP ROW
function osp_get_user_group_row($user_id = -1) {
if($user_id == -1) {
$user_id = osc_logged_user_id();
}
if($user_id > 0) {
$group = ModelOSP::newInstance()->getUserGroupRecord($user_id);
if(isset($group['pk_i_id'])) {
return $group;
}
}
return false;
}
// UPDATE BUSINESS PROFILE USER LABEL (html)
osc_add_filter('bpr_user_label', function($html, $user_id) {
if($user_id > 0) {
$group = osp_get_user_group_row($user_id);
if($group !== false) {
$color_style = ($group['s_color'] != '' ? 'background:' . $group['s_color'] . ';' : '');
$html = '<div class="bpr-user-type bpr-user-group-' . $group['pk_i_id'] . '" data-group-id="' . $group['pk_i_id'] . '" style="' . $color_style . '" title="' . osc_esc_html($group['s_description']) . '">';
$html .= $group['s_name'];
$html .= '</div>';
return $html;
}
}
return $html;
});
You should now get user membership group as label in business profile (will be included in next update).