*

tejville

  • **
  • 11 posts
Only users with Business Profile can post
« on: March 30, 2023, 12:38:58 PM »
I was looking around and found https://forums.osclasspoint.com/business-profile-plugin/how-can-i-allow-only-sellers-with-business-profile-enabled-to-post-a-listing/msg19236/#msg19236 but with no luck implementing it.

It is still available this function? Can you please explain how to implement it?

I've modified in header.php:

Code: [Select]
        <?php if(bpr_is_business(osc_logged_user_id())) { ?>
        <a class="publish btn mbBg2 isDesktop isTablet" href="<?php echo osc_item_post_url(); ?>">
          <span class="mbCl2">
            <svg version="1.1" widt="18px" height="18px" fill="<?php echo del_param('color2'); ?>" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 328.911 328.911" style="enable-background:new 0 0 328.911 328.911;" xml:space="preserve"> <g> <g> <path d="M310.199,18.71C297.735,6.242,282.65,0.007,264.951,0.007H63.954c-17.703,0-32.79,6.235-45.253,18.704 C6.235,31.177,0,46.261,0,63.96v200.991c0,17.515,6.232,32.552,18.701,45.11c12.467,12.566,27.553,18.843,45.253,18.843h201.004 c17.699,0,32.777-6.276,45.248-18.843c12.47-12.559,18.705-27.596,18.705-45.11V63.96 C328.911,46.261,322.666,31.177,310.199,18.71z M292.362,264.96c0,7.614-2.673,14.089-8.001,19.414 c-5.324,5.332-11.799,7.994-19.41,7.994H63.954c-7.614,0-14.082-2.662-19.414-7.994c-5.33-5.325-7.992-11.8-7.992-19.414V63.965 c0-7.613,2.662-14.086,7.992-19.414c5.327-5.327,11.8-7.994,19.414-7.994h201.004c7.61,0,14.086,2.663,19.41,7.994 c5.325,5.328,7.994,11.801,7.994,19.414V264.96z"/> <path d="M246.683,146.189H182.73V82.236c0-2.667-0.855-4.854-2.573-6.567c-1.704-1.714-3.895-2.568-6.564-2.568h-18.271 c-2.667,0-4.854,0.854-6.567,2.568c-1.714,1.713-2.568,3.903-2.568,6.567v63.954H82.233c-2.664,0-4.857,0.855-6.567,2.568 c-1.711,1.713-2.568,3.903-2.568,6.567v18.271c0,2.666,0.854,4.855,2.568,6.563c1.712,1.708,3.903,2.57,6.567,2.57h63.954v63.953 c0,2.666,0.854,4.855,2.568,6.563c1.713,1.711,3.903,2.566,6.567,2.566h18.271c2.67,0,4.86-0.855,6.564-2.566 c1.718-1.708,2.573-3.897,2.573-6.563V182.73h63.953c2.662,0,4.853-0.862,6.563-2.57c1.712-1.708,2.563-3.897,2.563-6.563v-18.271 c0-2.664-0.852-4.857-2.563-6.567C251.536,147.048,249.345,146.189,246.683,146.189z"/> </g> </g> </svg>
            <span><?php _e('Post an ad''delta'); ?></span>
          </span>
        </a>
        <?php ?>

and in functions.php

Code: [Select]
  if(bpr_is_business(osc_logged_user_id())) {
    osc_add_flash_error_message(__('Only premium users can create new ad.', 'delta'));
    header('Location:' . osc_base_url());
    exit;
  }

but with no luck. I can still se the Post an Ad button even if I am a simple user.

Thank you.



« Last Edit: March 30, 2023, 12:55:03 PM by tejville »

*

MB Themes

Re: Only users with Business Profile can post
« Reply #1 on: March 31, 2023, 02:28:09 PM »
Returns true when user has valid business profile.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots