Osclass Support Forums

Osclass plugin support => Osclass Pay Plugin => Topic started by: lbsib on March 23, 2023, 10:01:36 PM

Title: [Help]Show User Limit Message only when user is not in specific membershipgroups
Post by: lbsib on March 23, 2023, 10:01:36 PM
Hello,

I'm trying to show the osp_user_limit_message in the dashboard only when the user is not in certain groups.
In my case I have 4 groups (IDs 1-4) and I want to show it only when the user is in group 0 or 1.

I tried editing the functions.php of osclass pay but it didn't work, maybe it is the wrong section. This is the code that I used:
Line 675
Code: [Select]
function osp_user_limit_message() {
$group = ModelOSP::newInstance()->getUserGroupRecord(osc_user_id());
  if(osc_get_osclass_location() == 'user' && (osc_get_osclass_section() == 'dashboard' || osc_get_osclass_section() == 'items')) {
    if(osp_param('groups_limit_items') == 1 && $group['pk_i_id'] > 2){


Can someone tell me what I'm doing wrong here?

Thanks for your help.
Title: Re: [Help]Show User Limit Message only when user is not in specific membershipgroups
Post by: MB Themes on March 31, 2023, 03:29:37 PM
Use:
osc_logged_user_id()

Instead of:
osc_user_id()