PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Building membership site with GF and Members

  1. Hey, guys. I finally got that developer's license for GF. It's something I've been meaning to do for a while.

    I'm posting today because I'm thinking of getting rid of my current membership plugin and building a system with my Members plugin and GF (w/PayPal add-on) for http://themehybrid.com. Membership would be a one-time fee rather than subscription-based.

    Right now, from what I can tell, I'll need to implement these steps:

    * User signs up with regular signup form.
    * After logging in, the user can pay for an upgrade to the private areas of the site.
    * The payment gives them a unique key to enter to access private areas, which I know I can create to handle changing the user roles.

    Do you think this process can be done? Or, do you have alternate solutions that might work better?

    I'll be spending time this Saturday and Sunday working through some ideas (and updating Members too).

    Posted 14 years ago on Thursday November 25, 2010 | Permalink
  2. I've been looking through the code a bit and found three hooks that might be good possibilities to use: gform_paypal_post_ipn, gform_post_payment_status, and gform_paypal_fulfillment. The last one seems like the best hook for my needs.

    The goal is to create a function that will change the user's role to "gold_membership" upon successful completion of the payment. This form would only be shown to logged-in users with the default subscriber role. Here's what I'm thinking might work. What do you guys think?

    add_action( 'gform_paypal_fulfillment', 'my_update_user_role' );
    
    function my_update_user_role() {
    	global $current_user;
    
    	if ( !empty( $current_user->ID ) ) {
    		$new_user = new WP_User( $current_user->ID );
    
    		if ( !empty( $new_user ) )
    			$new_user->set_role( 'gold_membership' );
    	}
    }
    Posted 13 years ago on Sunday November 28, 2010 | Permalink
  3. We'll take a look at the hooks and add additional hooks where appropriate.

    We are also getting ready to release our User Registration Add-On that works in tandem with the PayPal Add-On that you may find useful. This allows you to use a form to register a user, pay through PayPal, and add the configured role when the user is registered.

    But it isn't setup to allow for existing users to be able to register/pay so that is the only drawback with it right now. So some custom integration would still be necessary.

    But yes, you should be able to role your own membership system using Gravity Forms and the PayPal Add-On.

    Posted 13 years ago on Monday November 29, 2010 | Permalink
  4. Hi,
    I just downloaded GF (with a developer's license) and Members a few days ago, and I'm trying to do something similar to what Justin is describing here.

    I'm building a crowdsourced investigative journalism site. I want to give people a choice to access certain restricted content: Either make a donation, or spend a minute filling out a form. Once they do either, I want them to get a password that's valid for a month or a year, depending on whether they gave money or completed the form.

    How can I make this work? Should I wait for the User Registration Add-On? Assume that my PHP knowledge is minimal, but that I can copy-paste code like a champ.

    Posted 13 years ago on Tuesday November 30, 2010 | Permalink
  5. Gravity Forms doesn't manage password protection of content. You can certainly do this with Gravity Forms, however it isn't something it does out of the box so it would require a customization using PHP to make it do what you want.

    If you wanted to control access based on user registration, then yes you could use the upcoming user registration add-on to register a user as part of your form process. But it would be based on full WordPress logins, not a password protected page.

    You would also have to use a plugin such as the Members plugin to then protect pages and set them so only logged in users can access them. Gravity Forms doesn't do access control.

    Posted 13 years ago on Tuesday November 30, 2010 | Permalink
  6. I'm good with developing my own features and can deal with existing users accordingly. Building a membership site is simple. Knowing how to interact with the payment system is the only thing I'm unfamiliar with. The biggest thing I need is the appropriate hook to switch a user's role based on a few bits of information.

    All I really need to know for sure is a few of things:

    * When a user has successfully paid for something.
    * Exactly what that user purchased.
    * What that user's ID is.

    I'd also need to know the opposite:

    * When a refund was issued.
    * What product the refund was for.
    * What the user's ID is.

    If I know the correct hook to get this information, I can make pretty much anything I need happen.

    Posted 13 years ago on Tuesday November 30, 2010 | Permalink
  7. Thanks, Carl. Thanks about what I figured. I'm OK with using the WordPress login system, but I'd hate to force first-time users to register with WP, *then* come back and fill out a second form to access content. That's why I look forward to the Registration Add-On. Any idea when a beta will be ready?

    Posted 13 years ago on Tuesday November 30, 2010 | Permalink
  8. Has any progress been made on this?
    With the PayPal addon, User Registration addon, and Members plugin, you could come up with nearly a perfect membership system.
    I say 'nearly' because ideally I'd have a subscription-based payment, and when the subscription is cancelled by a member via PayPal, then PayPal would notify the Members plugin so that accesss to protected content is cut off at the end of the billing cycle.
    I know this is possible because it's how the eMember plugin works. There's something called a subscription ID that PayPal creates and eMember recognizes.
    But I like the way Members looks like it works, it's free, and I have a lot of respect for Justin Tadlock as a developer. And Gravity Forms is the best thing since sliced bread.

    Posted 13 years ago on Monday June 27, 2011 | Permalink
  9. We've developed a system at DevPress.com that we're getting ready to deploy. It uses the User Registration Add-on, Members, and some code that interacts with e-Junkie. It'll probably be a while before we release the code to the public because we want to fix all the little issues that will inevitably crop up on a live site.

    Posted 13 years ago on Monday June 27, 2011 | Permalink
  10. Thanks for the update.

    Posted 13 years ago on Monday June 27, 2011 | Permalink

This topic has been resolved and has been closed to new replies.