strangerstudios / pmpro-sponsored-members

Generate a discount code for a main account holder to distribute to sponsored members.
https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
15 stars 27 forks source link

BUG: 'children_hide_email' and 'children_hide_password' fields not working #61

Open dparker1005 opened 5 years ago

dparker1005 commented 5 years ago

The JS that generates the box to fill in new user information does not account for $pmprosm_values['children_hide_email'] or $pmprosm_values['children_hide_password'].

See the code that generates this block here in the <script> of pmprosm_pmpro_checkout_boxes(): https://github.com/strangerstudios/pmpro-sponsored-members/blob/2d9612ad4422d1f078f5dd704273b3f4b9b16f38/pmpro-sponsored-members.php#L1131

Similarly, these values (along with $pmprosm_values['children_hide_username']) are not checked when the form is submitted, so checkout complains when any of these values are hidden since that field is empty.

See the code that generates an error here in pmprosm_pmpro_registration_checks_sponsored_accounts(): https://github.com/strangerstudios/pmpro-sponsored-members/blob/2d9612ad4422d1f078f5dd704273b3f4b9b16f38/pmpro-sponsored-members.php#L1516

dparker1005 commented 5 years ago

Also code needs to be updated in pmprosm_pmpro_after_checkout() to generate usernames, passwords, and to ignore emails if those options are hidden.

kimwhite commented 2 years ago

These attributes still appear on the Add Ons page, perhaps they should be removed until fixed.