Osclass Support Forums

Osclass plugin support => Business Profile Plugin => Topic started by: pitbull on March 23, 2019, 11:25:14 PM

Title: How can i allow only sellers with business profile enabled to post a listing?
Post by: pitbull on March 23, 2019, 11:25:14 PM
@Frosticek is there any way to allow only sellers with business profile enabled to post a listing ?
Title: Re: How can i allow only sellers with business profile enabled to post a listing?
Post by: Dannad on March 25, 2019, 01:40:51 AM
are u kidding or just make a prank for @Frosticek??

by the way, it´s not a serious question because you can enable or disable everone to publish some ad....

if don´t want user profile to post a ads, disable it... and let only business acount to publish it... ... ... if u dont know how to do it, disable option for personal ads , so only business account are able to post ads...
Title: Re: How can i allow only sellers with business profile enabled to post a listing?
Post by: pitbull on March 25, 2019, 04:36:36 PM
are u kidding or just make a prank for @Frosticek??

by the way, it´s not a serious question because you can enable or disable everone to publish some ad....

if don´t want user profile to post a ads, disable it... and let only business acount to publish it... ... ... if u dont know how to do it, disable option for personal ads , so only business account are able to post ads...

I dont have time for pranks and my questions are always serious. So i am asking the question again. Is there any way to disable simple users from posting ads in the site ? Osclass core doesn't have any option for doing that through backend.

@Frosticek??

Title: Re: How can i allow only sellers with business profile enabled to post a listing?
Post by: MB Themes on March 26, 2019, 08:05:13 AM
@pitbull
Use function:
Code: [Select]
bpr_is_business(osc_logged_user_id())
If user has valid business profile, it returns true, so you can use it to hide button:
<?php if(bpr_is_business(osc_logged_user_id())) { ?>
.... my publish ad button ...
<?php } ?>

Or on item-post.php to redirect user back to home if not valid:
Code: [Select]
  if(bpr_is_business(osc_logged_user_id())) {
    osc_add_flash_error_message(__('Only premium users can create new ad.', 'theme_name'));
    header('Location:' . osc_base_url());
    exit;
  }
Title: Re: How can i allow only sellers with business profile enabled to post a listing?
Post by: PeterB on December 09, 2020, 03:06:01 PM
Good day,

I know this is an old thread, however I am having the same problem and cant seem to get it working with the advice below.

I have a very limited understanding of PHP, please could you explain exactly which files to edit with what code and does it make a difference where I insert the code?