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

Hide Child Email and Password Fields #123

Closed JarrydLong closed 1 year ago

JarrydLong commented 1 year ago

All Submissions:

Changes proposed in this Pull Request:

Partial Bug Fix/Enhancement.

You can now add the 'children_hide_email' array key to the level settings and the child email address field will be hidden

We then create an email address as an alias of the sponsor's email address to create the user account.

Resolves #107

The code is very similar and works together so I've fixed the issue of Hide Child Password field in the same PR

Resolves #89

How to test the changes in this Pull Request:

  1. Set up your Sponsored Members with settings like this or similar
    
    global $pmprosm_sponsored_account_levels;
    $pmprosm_sponsored_account_levels = array(
    //set 5 seats at checkout
    1 => array(
        'main_level_id' => 1,
        'sponsored_level_id' => array(2, 3),
        // 'seats' => 5,
        'children_hide_email' => true,
        'max_seats' => 3,
        'seat_cost' => 49,
        'sponsored_accounts_at_checkout' => true
    ),
    );

Add 'children_hide_password' => true to the array to test the hidden password field functionality.



2. Purchase a parent level (1 in this case) and enter in a child accounts username and password
3. The child account will be created using an aliased email address from the sponored member.

### Other information:

* [x] Have you added an explanation of what your changes do and why you'd like us to include them?
* [x] Have you successfully run tests with your changes locally?

<!-- Mark completed items with an [x] -->

### Changelog entry

You can now add the 'children_hide_email' array key to the level settings and the child email address field will be hidden
JarrydLong commented 1 year ago

Note: #121 should be merged before this PR as the confirmation page throws an error after checking out with the above set up.