WordPress.org

Ready to get started?Download WordPress

Forums

Paid Memberships Pro
[resolved] Adding First and Last Name field to checkout (24 posts)

  1. kyledempster7
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to add a first and last name field to the membership checkout. I found a link you provided in another user request https://gist.github.com/strangerstudios/1389944. I tried to follow the instructions but they did not help and it actually crashed the page.

    I'm looking for wp-content/pages/checkout.php, correct? That is where I tried adding the code.

    Any help is appreciated.

    http://wordpress.org/extend/plugins/paid-memberships-pro/

  2. PMPro-Lisa
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Kyle,

    You should get these by default - no need to add. If you just set up PMPro with all of the default settings, these will appear at the top of the billing address.

    If you use the descriptions and terms of service, they will show above on the checkout page above the billing address.

    You do not alter any of the php files

    What version of PMPro are you using and what gateway?

  3. essaysnark
    Member
    Posted 1 year ago #

    Hi Lisa - Has PMPro been updated to include first/last names by default? With the version we're running (1.6.1) we had to include code from that Github page into our functions.php to capture first/last name with the PayPal checkout.

    @kyledempster7, if you're running the same setup as we are, then you'll want to put that code into functions.php or a custom plugin created for that purpose. (If you're not familiar with editing functions.php, just be very careful - take a backup first, and make sure you have FTP access to your server, so you can restore the original file if something goes wrong - also, remember that the opening PHP tag doesn't get copied in.)

  4. PMPro-Lisa
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @Essaysnark,

    This is why I asked what gateway - I use Stripe on my site and I have these above the address.

    @Kyle - please keep in mind that github is for developers only - so if you would like more help with that we do have a developers forum that you can sign up for at Paid Memberships Pro http://www.paidmembershipspro.com/pricing.

  5. kyledempster7
    Member
    Posted 1 year ago #

    I work for a non-profit and I have to propve that the service works well enough before we buy into it.

    We have Paypal Standard set as the payment gateway. I watched one of our employees check out using a test form where they submitted $1. The only information it asked them to create was a username and password.

    My concern is that we need members first and last name, email and phone number.

    I'm using Version 1.6.1

  6. essaysnark
    Member
    Posted 1 year ago #

    @kyledempster7, the code you linked to and the instructions I offered are better for PayPal Express. For PayPal Standard, you can use the Register Helper plugin. The files you need are here: https://github.com/strangerstudios/pmpro-register-helper

  7. kyledempster7
    Member
    Posted 1 year ago #

    Thanks for that great info @essaysnark.

    Maybe this is a silly question but I have read the Read Me and I'm still having trouble determining where you put the 'field' you just made.

    Would that go in the functions.php that you mentioned earlier or does the new field go within the plugin itself?

  8. essaysnark
    Member
    Posted 1 year ago #

    The field goes in the main plugin file - by default, /pmpro-register-helper-master/pmpro-register-helper-master.php

    There's an example in the code that's commented-out:

    /*
    $text = new PMProRH_Field("company", "text", array("size"=>40, "class"=>"company", "profile"=>true, "required"=>true));
    pmprorh_add_registration_field("after_billing_fields", $text);
    */

    Those are essentially the two lines you need: one to define the field, then the function that adds it. You'd need to also use the pmpro_signup shortcode specified in the readme on a post or page to display the checkout form. You could try simply un-commenting that block in the PHP file and see if it works.

    Unfortunately I just tried doing so and I can't get the new field to display on my checkout form - it's going into the user profile screen so I know it's working but I didn't manage to get it all the way there. I don't have time to investigate further right now but maybe you can get it working on your site. Please report back and let us know how you do!

  9. essaysnark
    Member
    Posted 1 year ago #

    Well I couldn't let it go - and I'm glad I didn't, because the plugin was in fact working, I just wasn't implementing it right - and even worse, I've given you some bad information.

    To correct the record:

    The shortcode mentioned in the helper plugin readme doesn't have anything to do with the added fields, I think it's just a second feature that this plugin offers. The fields you add with the plugin will show up on the regular Membership Checkout form but not on a checkout form rendered through the pmpro_signup shortcode

    The bigger issue though: This plugin is for adding *new* fields - and the first/last name fields already exist on the WP user record. (I was going off info from this thread http://wordpress.org/support/topic/rrequire-firstlast-name-extension-no-longer-working?replies=6 but I think I got confused).

    I actually don't know how to display the WP user first/last name fields with PayPal Standard. And I don't think you'd want to have this plugin create new fields since those two fields already exist.

    One thing you might try: In PMPro, you can switch the payment gateway to PayPal Express and then use these instructions: http://www.paidmembershipspro.com/2011/09/add-first-and-last-name-fields-to-the-checkout-form/

    We're using the PayPal Express gateway with PMPro even though our PayPal account technically is "PayPal Standard" and it works fine. So that might be the easiest.

    Sorry to send you on a wild goose chase! The good part of PMPro is that it's completely open and you can do anything you want with it; the sometimes-challenging part is making it do exactly what you want, given all the options out there. I just bumble along to make stuff work, am not an expert - obviously right? ;-)

  10. kyledempster7
    Member
    Posted 1 year ago #

    @eassaysnark, I really appreciate all of the time you have put into this.

    I just changed our gateway payment option to paypal express (in paid membership pro) and it still did not ask for anything more than Username, password and email.

    Sadly, I can't read the post you gave because it requires a membership to read it (http://www.paidmembershipspro.com/2011/09/add-first-and-last-name-fields-to-the-checkout-form/).

  11. essaysnark
    Member
    Posted 1 year ago #

    The PayPal Express gateway still needs modifications (to functions.php) in order to display those two fields, it's not automatic. From what Lisa said, it sounds like maybe the Stripe integration shows those fields by default, in case Stripe would be an option instead.

    If you want to plow ahead with PayPal, then you just need to insert some code into functions.php - and for that, I think you can sign up on Jason's site for free to see the article, you just need to register for an account first.

  12. Lisa
    Member
    Posted 1 year ago #

    Hi Kyle you can use Stripe in test mode and verify that this works.

    You can create an account with Stripe for free.

    The best thing about Stripe is that once you get going, your bank transfers happen automatically, they don't just sit in some Stripe account until you transfer them, like how it works with PayPal.

    Super easy. Just set it up with all the default settings and it works.

  13. PMPro-Lisa
    Member
    Plugin Author

    Posted 1 year ago #

    Here's how it looks on Stripe:

    https://www.evernote.com/shard/s9/sh/a62d98c9-7640-422f-9075-6657969d6eb6/ce844c9fce4346d74c0b6b29583f34cf/res/24d9d3fa-629a-444b-91a0-7431342d0bd2/skitch.png

    Kyle - You can register to read the documentation -

    http://www.paidmembershipspro.com/support/

    Also check back because I'll be revising the initial set up docs in the next week. We just redid our website, so stay tuned more more info, and be sure to subscribe to the blog. But keep in mind, that although the plugin in free, but we do charge for support:)

  14. kyledempster7
    Member
    Posted 1 year ago #

    @Lisa I did register to read the information. Sadly, I cannot see the Evernote link. It's giving an access error.

  15. PMPro-Lisa
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Kyle -

    I just tried it in 2 other non logged in browsers, so I think you may have another issue?

    Try from another computer or network if you can.

    But it just shows the First name, Last name fields on the checkout.

  16. essaysnark
    Member
    Posted 1 year ago #

    @Lisa, just FYI, I can't see the Evernote link either.

  17. kyledempster7
    Member
    Posted 1 year ago #

    @Lisa I keep getting the following error "Oops, we encountered an error.

    Access denied.
    You have accessed a location on this server that is not available.
    You may need to Sign in to your account to access this page."

    I am looking into using Stripe. It looks like a good service.

  18. PMPro-Lisa
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks @Essaysnark for the heads up.

    @Kyle - Just take my word for it - they are there:) Stripe is very easy and saves a lot of confusion compared to PayPal.

    I actually use both for different applications, but think in your case you will find Stripe much simpler.

    Hope this helps!

  19. kyledempster7
    Member
    Posted 1 year ago #

    Sadly, I did not get approval to use Stripe. I guess that means I am back to square one with using Paypal.

  20. essaysnark
    Member
    Posted 1 year ago #

    It should be really easy to set up when PayPal Express is selected as the PMPro gateway. Were you able to access the instructions here? http://www.paidmembershipspro.com/2011/09/add-first-and-last-name-fields-to-the-checkout-form/

  21. essaysnark
    Member
    Posted 1 year ago #

    @kyledempster7 did you ever make headway on this? I sent you down a rabbit hole originally but it's really not that hard to do with PayPal Express. How did you make out?

  22. PMPro-Lisa
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Kyle,

    We have a new installation and setup video that will help. Again you can register for the documentation at

    http://www.paidmembershipspro.com/documentation/

  23. strangerstudios
    Member
    Plugin Author

    Posted 1 year ago #

    Not to belabor this, but I put together a different solution for someone that should work with PayPal Express and is the preferred method now for doing this I think.

    This code will keep the address fields (including first and last name) on the checkout page even if the level is free or a free discount code is used:
    https://gist.github.com/strangerstudios/5716249

    Hope this helps some people.

  24. madphill
    Member
    Posted 11 months ago #

    @strangerstudios Thanks for putting that together man! Huge help. First and Last name were a requirement for my project and although I didn't 'need' address etc. this was a great patch over.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.