Skip to content

Conversation

@iamdharmesh
Copy link
Collaborator

Description of the Change

This PR updates the existing behavior of how form fields are displayed on the form. Currently, form fields are shown based on a combination of settings from both Mailchimp and WordPress. If a form field is marked as hidden in Mailchimp, it does not appear on the form, while a visible field can be included in the form based on the settings on the WordPress side.

This PR updates this behavior so that form field visibility is determined solely by the "Include?" option in the WordPress settings, regardless of the Mailchimp settings.

When a new list is set up, hidden fields in Mailchimp will have their "Include?" setting turned off (hidden) by default. Additionally, this PR includes an upgrade script to ensure that forms with hidden fields based on Mailchimp settings do not accidentally start displaying after the update.

Closes #34

How to test the Change

  1. Mark a few form fields as hidden in Mailchimp.
  2. Go to the Mailchimp settings page in wp-admin, log in to your Mailchimp account, and select an audience list.
  3. Verify that hidden fields have their "Include?" setting turned off (checkbox unchecked) by default.
  4. Enable the "Include?" option for hidden fields and save the settings.
  5. Go to the front end and verify that the form field is now visible.
  6. Submit the form with values and confirm that:
    • The form submits successfully.
    • The submitted details are correctly reflected in the Mailchimp contact.

Backward Compatibility

  1. For existing users on the trunk branch:
    • Set up the plugin and form.
    • Verify that form fields are hidden based on Mailchimp settings.
  2. Update to this PR branch and change the plugin version to 1.7.0 in mailchimp.php by replacing the line with:
    define( 'MCSF_VER', '1.7.0' );
  3. Visit the settings page and ensure that all hidden fields have "Include?" turned off and are not visible on the front end.

Changelog Entry

Changed - Make the form field visibility dependent on the WordPress "Include?" settings instead of the Mailchimp settings.

Credits

Props @qasumitbagthariya @dkotter @jeffpaul @MaxwellGarceau @iamdharmesh

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@iamdharmesh iamdharmesh self-assigned this Mar 31, 2025
@github-actions github-actions bot added this to the 1.7.0 milestone Mar 31, 2025
@iamdharmesh iamdharmesh requested a review from dkotter March 31, 2025 11:37
@iamdharmesh iamdharmesh marked this pull request as ready for review March 31, 2025 11:37
@github-actions github-actions bot added the needs:code-review This requires code review. label Mar 31, 2025
Co-authored-by: Darin Kotter <[email protected]>
@qasumitbagthariya
Copy link
Collaborator

QA Update ✅


I have verified this PR in the fix/34 branch, which has been fixed and is functioning as intended.

I tested the following on this branch:

  • Follow the test steps provided in the PR description.
  • Backward Compatibility
Backward.Compatibility-mailchimp.mov
Mailchimp.-.1.mov

Testing Environment

  • WordPress: 6.7.2
  • Theme: Storefront 4.6.1
  • Theme: Twenty Twenty-Four 1.3
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: fix/34

Steps to Test- As mentioned in the PR description.
Test Results - It is working as expected.
Functional Demo / Screencast -
Special Notes - Ready forUAT
Testing Document status:
Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

  • Yes
  • Not Required/Applicable for this PR

@qasumitbagthariya
Copy link
Collaborator

Regression / Smoke Test Report ✅

Tested with the smoke-testing branch, it works as expected, similar to the fix-specific branch.

Testing Environment

  • WordPress: 6.7.2
  • Theme: Storefront 4.6.0
  • Theme: Twenty Twenty-Four 1.3
  • PHP: 8.2.23
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS 15.2
  • Branch: smoke-testing

Next Step- Ready to Merge 🚀

@vikrampm1 vikrampm1 merged commit 3c0f4b9 into develop Apr 7, 2025
11 checks passed
@vikrampm1 vikrampm1 mentioned this pull request Apr 7, 2025
29 tasks
@dkotter dkotter deleted the fix/34 branch May 8, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address and Phone Number Form Fields Missing on Frontend

5 participants