Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Last active April 4, 2021 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimcoleman/ccfeeaddd998f2acf5e177d5cb18b7b2 to your computer and use it in GitHub Desktop.
Save kimcoleman/ccfeeaddd998f2acf5e177d5cb18b7b2 to your computer and use it in GitHub Desktop.
Simplify paid level checkouts by removing Account Information section and generating username and password.
<?php
/**
* Simplify paid level checkouts by removing Account Information section and generating username and password.
* You must be capturing full Billing Information for this recipe to work.
*/
/**
* Hide the Account Information Section
*/
function simple_checkout_hide_account_information_section( $skip_account_fields, $current_user ) {
if ( empty( $current_user->ID ) ) {
$skip_account_fields = 1;
}
return $skip_account_fields;
}
add_filter( 'pmpro_skip_account_fields', 'simple_checkout_hide_account_information_section', 10, 2 );
/**
* Unset required account fields, we'll use Register Helper to require our new fields.
*/
function my_required_user_fields( $pmpro_required_user_fields ) {
unset( $pmpro_required_user_fields['username'] );
unset( $pmpro_required_user_fields['password'] );
unset( $pmpro_required_user_fields['password2'] );
unset( $pmpro_required_user_fields['bconfirmemail'] );
return $pmpro_required_user_fields;
}
add_filter( 'pmpro_required_user_fields', 'my_required_user_fields', 10, 2);
/**
* Don't include the "confirm email" field in Billing Information
*/
add_filter( 'pmpro_checkout_confirm_email', '__return_false' );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Increase Conversion Rates with a Simplified Checkout" at Paid Memberships Pro here: https://www.paidmembershipspro.com/increase-conversion-rates-with-a-simplified-checkout/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment