• Resolved stefansecrieru

    (@stefansecrieru)


    I am trying to restrict memberships to specific user roles. I noticed that, when creating a membership, you can specify a user role (last input field), but I want to restrict that membership to that user role only. So, for example, when a user that has the associated role: Student, goes to purchase a new subscription, I only want him to see the Student related ones, not all memberships. The content restriction is nice, but it only allows to filter out Guttenberg, Elementor etc. blocks, whereas I would want it to restrict the memberships themselves.

    Would this be possible in any way?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @stefansecrieru,

    This can’t really be done through the available features because the restriction options from the plugin are based on the Subscription Plans that you are able to create. We only use the roles as an extension of our subscriptions so that they can be used by 3rd party plugins for other functionalities.

    There is a filter that lets you customize the subscription plans output, so you could leverage this to make a form behave in this way. I can share an example with you if you find this interesting.

    For a no code option, we do have another plugin that offers similar content restriction options but they are based on User Roles. You could make use of this plugin to achieve what you want.

    This is called Profile Builder and the two plugins are also compatible in other ways. You can read more about that here: https://www.cozmoslabs.com/docs/paid-member-subscriptions/integration-with-other-plugins/profile-builder/

    Anyway, you could achieve what you’re looking for by using the [wppb-restrict] shortcode in combination with the user role you want to make that content available for and then inside of the shortcode you place the pms register form shortcode with the subscription plans parameter specifying the plans you want this role to be able to purchase.

    Regards.

    Thread Starter stefansecrieru

    (@stefansecrieru)

    @raster02 Hey there!

    Thanks a really lot for the valuable insights! I found a solution after all ( kind of taking away what you suggested and integrating it in the application with other plugins ).

    So, I made a special page that holds all the memberships but they are conditionally rendered using Elementor’s beta Conditional Display functionality. This allows to only display a certain membership based on the user role.

    Now, the only problem that remains is the [pms-register] page that displays all the memberships no matter what. I am thinking about using a 301 redirect to my custom memberships page that has the conditional logic.

    Thanks for the help @raster02.

    Keep up the good work and thanks a lot again!!!!

    Plugin Author Georgian Cocora

    (@raster02)

    Hello @stefansecrieru,

    You can choose which plans to display inside that shortcode using a parameter: https://www.cozmoslabs.com/docs/paid-member-subscriptions/shortcodes/#Choose_which_subscription_plans_to_show

    Not sure if this is what you meant.

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restrict membership type to certain user role’ is closed to new replies.