integration with Paid Membership Pro

Posted by: Elio Bergamini

23rd November 2020, 7:32 pm

Elio Bergamini

@elioberga

23 Nov 2020
7:32 pm

1. Hi, is it possibile to integrate the plugin with Paid Memberships Pro? Only user who bought a particular membership plan could be able to download a file, the other (even if logged in) can’t.

2. Is it possibile to restrict the download basing on the role? Not just a download limit but if the role can or can’t download.

Thanks!

  • Richard Webster

    @rwebster

    23 Nov 2020
    7:55 pm

    Hi Elio, do you mean to restrict purchasing of the products as well, based on membership? Or do you want non members to be able to add these free products to cart instead of instant download?

  • Elio Bergamini

    @elioberga

    23 Nov 2020
    8:03 pm

    Hi,

    I am creating a portal where user who subscribed, using paid memberships pro (the free version) have access to all the catalog of digital download product with price 0. Your plugin works perfectly and users who logged in can directly download the file while not logged user can't. People without an active paid membership should be able to just see the produt page but not to download the file.

    I would like it to be more flexible, so people with an active paying subscription can download and not only logged in users and maybe decide basing on their plan which files are accessible.

    So yes, to restrict purchasing of the products (free download), based on membership (and the membership should still be active).

    Thanks.

    Last modified: 23rd November 2020, 8:08 pm by Elio Bergamini

  • Richard Webster

    @rwebster

    23 Nov 2020
    8:11 pm

    You probably want to look at product restriction. I'm sure there's add-ons for PMPro that do that. You could make the products free but restrict purchase to members only. Something like that.

  • Elio Bergamini

    @elioberga

    23 Nov 2020
    8:27 pm

    Yes, but I am using the free version of PMPro. I think I just need to understand if I can show your "Download Now" button under a custom condition in a css. I need to decide wheter to show the download button or no (and show another sentence) with the if condition  if( pmpro_hasMembershipLevel() ).

    This is an example to hide the price.

    add_filter( 'woocommerce_get_price_html', function( $price ) {
    if( pmpro_hasMembershipLevel() ){
    return $price;
    }

    if ( is_admin() ) return $price;

    return '';

    } );

    I bought the pro because I taught it was possible.

    Thanks!

  • Richard Webster

    @rwebster

    23 Nov 2020
    8:44 pm

    Yea without one of their add-ons to make product restrictions you'll need some custom code. I might be able to help.

    Is it all your free products that you'd want to be for members? If it's not every free item, could you tag the ones you'd want included, making use of my advanced product restrictions setting?

    Last modified: 23rd November 2020, 8:44 pm by Richard Webster

  • Elio Bergamini

    @elioberga

    23 Nov 2020
    8:46 pm

    all of the products that are with price 0. yes I could give them a tag if it's simplier, but still they need to satisfy the condition pmpro_hasMembershipLevel( 1 )

    It would be a good start to add something like this:

    if ( is_user_logged_in() && pmpro_hasMembershipLevel( 1 ) ) {

    Instead of the simple condition if user is logged in (that works great!).

    Is it possible?

    Thanks.

    Last modified: 23rd November 2020, 8:49 pm by Elio Bergamini

  • Richard Webster

    @rwebster

    24 Nov 2020
    11:35 am

    I'm just working through some Uni stuff this week but I'll have some custom code for you at some point soon don't worry.

  • Elio Bergamini

    @elioberga

    24 Nov 2020
    12:20 pm

    Ok thanks Richard!

  • Elio Bergamini

    @elioberga

    30 Nov 2020
    8:16 pm

    Hi,

    did you manage to think about my request? I really need it for my website and I am thinking if free downloads is the right tool.

    Thanks.

  • Richard Webster

    @rwebster

    1 Dec 2020
    1:57 am

    Hi Elio, yea I've been mulling it over. Will you be setting it so that users with any membership plan can download free products, and users without a plan (whether logged in or not) will have a message on the product page telling them to sign up to a plan?