computerFace
Forum Replies Created
-
Thank you, Pete. This is a client’s site and will be updating the site to the newest WP and PMPRO within the month. Hopefully this issue will be a nonissue at that point.
Thanks!
Jason,
Despite my efforts, it looks like PMPRO is still erasing the user’s first and last name when they go off to PayPal Express. Can you please take a look at the code and let me know if you spot any glaring issues?
I posted what I think are the two files responsible for these transactions below.
https://gist.github.com/anonymous/2eb78d4ac836863edef1
Thank you for any and all help. I know you’re busy!
Andrew
Nevermind – I found this chunk of code at the end of the pmpro-register-helper-fields.php file that for some reason was trying to update the first and last name. I’ve commented it out, and now first and last names are not being erased.
This isn’t part of the original plug-in code right? I’m assuming a prior developer wrote this:
//update the user after checkout /*function pmproan2c_update_first_and_last_name_after_checkout($user_id) { if(!empty($_REQUEST['first_name'])) $first_name = $_REQUEST['first_name']; elseif(!empty($_SESSION['first_name'])) $first_name = $_SESSION['first_name']; else $first_name = ""; if(!empty($_REQUEST['last_name'])) $last_name = $_REQUEST['last_name']; elseif(!empty($_SESSION['last_name'])) $last_name = $_SESSION['last_name']; else $last_name = ""; update_user_meta($user_id, "first_name", $first_name); update_user_meta($user_id, "last_name", $last_name); } add_action('pmpro_after_checkout', 'pmproan2c_update_first_and_last_name_after_checkout'); function pmproan2c_pmpro_paypalexpress_session_vars() { //save our added fields in session while the user goes off to PayPal $_SESSION['first_name'] = $_REQUEST['first_name']; $_SESSION['last_name'] = $_REQUEST['last_name']; } add_action("pmpro_paypalexpress_session_vars", "pmproan2c_pmpro_paypalexpress_session_vars");*/Jason,
Thank you for the helpful information. I can definitely include the code. Can you please confirm which file(s) you need me to share with you?
Thanks,
Andrew Jordan
Erwin,
You can do this with PMPro’s pmpro-register-helper add-on plugin. Add the plugin to your WordPress site and then follow the instructions to setup the file that will allow these fields to appear at checkout. It’s pretty straight forward once you read the instructions:Click on that page’s ‘Adding Fields’ tab to see how to specify each field.
Hope that helps.