Shortcodes for pro site plugin

I have installed the pro site plugin in my multisite. Also i have set the marketpress plugin should be enable only for a certain level(Premium).

In my blog index page i have written a code mp_list_product() which is the shortcode of marketpres. This code works fine for the users who are in premium level. But the same code is showing some error for the users who are in some other level.

So, i need to check the users current level of the pro site plugin. How can i get the pro level of the current user? Is there shortcodes available as provided in the marketpress plugin? or some other way to get the user level info of pro site plugin?

  • Tom Eagles
    • Syntax Hero

    @letprice

    I am really not sure what you are trying to achieve here, prosites restricts plugins on a subsite basis, what that means is they don't have access to install it on their subsite. It has nothing to do with them visiting a site in the network that has it activated.

    Cheers

    Tom

  • letprice
    • New Recruit

    @Tom Eagles

    Thank you for your reply.

    What i need to do is, display the global products of the main site in all the sub-site. But sub-site admin should not add any more products in their site. They will just list the product of the main site and sell the product behalf of the main site.

  • mort3n
    • The Crimson Coder

    Hi letprice,

    Here's how I understand it : You only enable MarketPress on Premium level subsites. However, you have made a custom page with MarketPress functionality, that is used on all sites.

    Your goal is to only use the MarketPress functionality on the Premium level subsites.

    Is that correct? If not, please advise :slight_smile:

    If you've constructed your page using a custom page template, then I guess you could make template specific to each level.

    If you want just one page, then you could check whether MarketPress is available before using it.

    I'm a bit confused about exactly how you use it. You have written a function call

    mp_list_product()

    But refer to it as a shortcode. Which one are you using?

    If you call a function you could check that the function exists before calling it, ie.

    if( function_exists( 'mp_list_product' ) ){
      // do what you need to do related to the function call
      mp_list_product();
    }

    If you use a shortcode, then you shouldn't get an error, the shortcode should just be shown in case MarketPress isn't available.

    Could you provide details about the error you encounter?

    Cheers
    Mort3n

  • Mike
    • New Recruit

    Hiya, we haven't heard from you in a short while so I just wanted to check in and see how things are going here?

    If you still need some assistance then by all means just reopen the thread or create another one for any new and related issues.

    Cheers.
    Mike

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.