December 9, 2013 at 13:26
#7955
Keymaster
Hello,
The thing is that you cannot checkout for a level before you have an account .. so going to checkout page and only after that to the register page is not possible.
You can send users to the register page and after their first login redirect them to the levels page with this code added to sweetdate-child/functions.php
COPY CODE
function function_new_user($user_id) {
add_user_meta( $user_id, '_new_user', '1' );
}
add_action( 'user_register', 'function_new_user');
//The next function will check if it's the first login and redirect the user.
function function_check_login_redirect($user_login, $user) {
$logincontrol = get_user_meta($user->ID, '_new_user', 'TRUE');
if ( $logincontrol ) {
//set the user to old
update_user_meta( $user->ID, '_new_user', '0' );
//Do the redirects or whatever you need to do for the first login
wp_redirect( pmpro_url(), 302 ); exit;
}
}
add_action('wp_login', 'function_check_login_redirect', 10, 2);
or
PMPRO by default allows registration from the checkout page but you won’t use the Buddypress register page. To enable the default behaviour you need to replace the content of this file wp-content/themes/sweetdate/paid-memberships-pro/pages/checkout.php with attached file
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.