Closed ipokkel closed 4 years ago
When an existing user or active member checks out or changes a level and the first_name and last_name fields are empty the registration is still accepted.
Should we perhaps consider validating only against the variables $first_name and $last_name as existing data for these are assigned to values for these variables at the beginning of pmproan2c_pmpro_registration_checks here https://github.com/strangerstudios/pmpro-add-name-to-checkout/blob/5ff8976ca2e5e848162165adad84e37c8729ab09/pmpro-add-name-to-checkout.php#L83-L84 and here https://github.com/strangerstudios/pmpro-add-name-to-checkout/blob/5ff8976ca2e5e848162165adad84e37c8729ab09/pmpro-add-name-to-checkout.php#L93-L94
$first_name
$last_name
pmproan2c_pmpro_registration_checks
Change
if ( $first_name && $last_name || $current_user->ID ) { //all good return true; }
to
if ( $first_name && $last_name ) { //all good return true; }
Reference: https://github.com/strangerstudios/pmpro-add-name-to-checkout/blob/5ff8976ca2e5e848162165adad84e37c8729ab09/pmpro-add-name-to-checkout.php#L99
When an existing user or active member checks out or changes a level and the first_name and last_name fields are empty the registration is still accepted.
Should we perhaps consider validating only against the variables
$first_name
and$last_name
as existing data for these are assigned to values for these variables at the beginning ofpmproan2c_pmpro_registration_checks
here https://github.com/strangerstudios/pmpro-add-name-to-checkout/blob/5ff8976ca2e5e848162165adad84e37c8729ab09/pmpro-add-name-to-checkout.php#L83-L84 and here https://github.com/strangerstudios/pmpro-add-name-to-checkout/blob/5ff8976ca2e5e848162165adad84e37c8729ab09/pmpro-add-name-to-checkout.php#L93-L94Change
to
Reference: https://github.com/strangerstudios/pmpro-add-name-to-checkout/blob/5ff8976ca2e5e848162165adad84e37c8729ab09/pmpro-add-name-to-checkout.php#L99