Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIXING] User Fields Incorrectly Marked as Required During Checkout Despite Being Unset Using pmpro_required_user_fields Filter #3320

Conversation

MaximilianoRicoTabo
Copy link
Contributor

  • Add a helper function that takes field name and field type and based on globals required fields, that can be filtered, return an array with values to build the field HTML block
  • Pull values for each field and build the block based on this.
  • Remove jQuery code that add required stuff without take into consideration filtered required fields.
image image

All Submissions:

Changes proposed in this Pull Request:

Instead of adding required css clases, asterisks and aria attributes after checkout page DOM's load with jQuery, build blocks in the server side bringing the info from a helper function based on field name, field type and global required fields ( after potentially filtered ).

Resolves #3165 .

How to test the changes in this Pull Request:

  1. Apply the patch
  2. Create a snippet filtering pmpro_required_billing_fields and pmpro_required_user_fields and try setting and unsetting different fields.
  3. Observe that required UI stuff is added or not based on filtered required fields.

Other information:

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

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

…t Despite Being Unset Using pmpro_required_user_fields Filter

 * Add a helper function that takes field name and field type and based on globals required fields, that  can be filtered, return an array with values to build the field HTML block
 * Pull values for each field and build the block based on this.
 * Remove jQuery code that add required stuff without take into consideration filtered required fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant