Osclass Support Forums
Osclass plugin support => Business Profile Plugin => Topic started 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 ?
-
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...
-
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??
-
@pitbull
Use function:
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:
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;
}
-
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?