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

Marking sponsored members by using required attribute #108

Closed sensemonster closed 1 year ago

sensemonster commented 2 years ago

All Submissions:

Changes proposed in this Pull Request:

Resolves inconsistent email address field length and compulsory field attributes of sponsored member fields.

How to test the changes in this Pull Request:

  1. Create checkout where a single sponsored membership will be created
  2. Ensure that the sponsored membership details include email address required along with First Name and Last Name
  3. Add a code snippet to also add the email address2 for email address verification (make it 30 long as 20 is too small for most).
  4. Submit the form without filling in any details
  5. Verify that all of the required fields are highlighted

Other information:

Changelog entry

Ensures the given sponsored member details are shown as required when rendered and appropriate highlighting when in error state if values are not provided.

dparker1005 commented 2 years ago

Linking to #103

sensemonster commented 2 years ago

Elected to call it "Marking sponsored members by using the required attribute"

dwanjuki commented 1 year ago

I noted that when there are some unpopulated sponsored member fields, populated sponsored member fields are inappropriately highlighted as well.

dparker1005 commented 1 year ago

Closing in favor of #103.

As written, this code always shows child fields as red (error) when they are generated during the page load. This is problematic when the number of seats is hard-coded instead of variable. In this case, the child account fields show as error even before the user attempts to check out.