This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

pitbull

  • **
  • 98 posts
@Frosticek is there any way to allow only sellers with business profile enabled to post a listing ?

*

Dannad

  • *
  • 9 posts
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...

*

pitbull

  • **
  • 98 posts
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??


Marked as best answer by pitbull on March 26, 2019, 09:55:48 AM
*

MB Themes

@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;
  }
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

PeterB

  • *
  • 2 posts
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?