Skip to content

fix: hide modal content gate when checkout is opened#3953

Merged
laurelfulford merged 2 commits into
trunkfrom
fix/membership-gate-layering
May 15, 2025
Merged

fix: hide modal content gate when checkout is opened#3953
laurelfulford merged 2 commits into
trunkfrom
fix/membership-gate-layering

Conversation

@laurelfulford

@laurelfulford laurelfulford commented Apr 25, 2025

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR updates some CSS that was used to hide the modal content gate when the Audience Development Sign In or any state of the Modal Checkout was open (variation picker, checkout, thank you, newsletter modal).

It also adds a CSS class to the body when a purchase/sign up would normally refresh the page, so the gate can be hidden while that's happening.

See: 1200550061930446-as-1209980970331853

How to test the changes in this Pull Request:

  1. Set up a Woo Membership that restricts content.
  2. Set up two products to purchase to get access to that membership: one a regular subscription product, and one a variable subscription product.
  3. Set up a Content Gate, and set it to display as an overlay. Add two checkout button blocks, one for each of your subscription products.
  4. In an incognito window, view a post that shows the gate, and click on one of the checkout button blocks. Note that the gate is still visible behind the checkout:

CleanShot 2025-04-29 at 16 57 49

  1. Apply this PR and run npm run build.
  2. In an incognito window, try to purchase one of the memberships from the gate; confirm that the content gate modal is hidden while the checkout is open.
  3. Close the checkout modal without completing the purchase, and make sure the content gate comes back.
  4. Try checking out with the button that opens the variation picker, and confirm the gate goes away.

CleanShot 2025-04-29 at 17 01 03@2x

  1. Complete a purchase of the membership product, and confirm that when you're done, the modal checkout will close but the gate doesn't come back while the page is reloading (you'll still only see the excerpt until the page refreshes).
  2. Under Audience > Checkout & Payment, enable "Require sign in or create account before checkout".
  3. In the incognito window repeat the above steps: confirm that the content gate goes away while the sign in modal is opened, and will come back when you close the sign in modal without filling it in, but not when you complete a transaction.
  4. Under Audience > Configuration, enable "Present newsletter signup after checkout and registration" and turn on a couple lists.
  5. In the incognito window, run one more checkout and confirm that the content gate is still hidden when the newsletters modal is open, but that it doesn't come back when you click 'Continue' on that modal or just close it.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford added the [Status] Needs Review The issue or pull request needs to be reviewed label Apr 30, 2025
@laurelfulford laurelfulford marked this pull request as ready for review April 30, 2025 00:05
@laurelfulford laurelfulford requested a review from a team as a code owner April 30, 2025 00:05
@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels May 14, 2025
@laurelfulford

Copy link
Copy Markdown
Contributor Author

Thanks @dkoo!

@laurelfulford laurelfulford merged commit a503973 into trunk May 15, 2025
9 checks passed
@laurelfulford laurelfulford deleted the fix/membership-gate-layering branch May 15, 2025 15:53
@github-actions

Copy link
Copy Markdown

Hey @laurelfulford, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request May 23, 2025
# [6.7.0-alpha.1](v6.6.2...v6.7.0-alpha.1) (2025-05-23)

### Bug Fixes

* **404-images:** use JS without modifying content ([#3963](#3963)) ([9f5646b](9f5646b))
* add missing namespace ([#3980](#3980)) ([6d58793](6d58793))
* **emails:** add missing HTML markup in the change-email-cancel template ([#3981](#3981)) ([040ae30](040ae30))
* **ga4:** fire login/registration activities via SSO ([#3965](#3965)) ([8c97515](8c97515))
* hide modal content gate when modal checkout is opened ([#3953](#3953)) ([a503973](a503973))
* **jetpack:** handle the related posts max age option ([#3964](#3964)) ([8aad2b8](8aad2b8))
* make sure fix duplcate fields apply filters ([#3971](#3971)) ([f361a4e](f361a4e))
* namespace Lite Site ([#3975](#3975)) ([e4665ae](e4665ae))
* sync correction status with parent post status ([#3978](#3978)) ([dcd5a12](dcd5a12))

### Features

* add compatibility to network in custom bylines ([#3972](#3972)) ([199a993](199a993))
* add icons repository and remove custom icons ([#3883](#3883)) ([e56d2e0](e56d2e0))
* **analytics:** "My Account" dashboard interactions ([#3949](#3949)) ([22e9590](22e9590))
* **donations:** update notice style and type ([#3962](#3962)) ([3f60ef3](3f60ef3))
* **email-change:** remove env constant requirement ([#3943](#3943)) ([4158bf1](4158bf1))
* **my-account:** apply Newspack UI styles to My Account w/ env constant ([#3951](#3951)) ([e4aa5a2](e4aa5a2))
* **my-account:** full-site takeover template and custom nav menu ([#3974](#3974)) ([5cf8403](5cf8403))
* **woocommerce:** log error notices ([#3952](#3952)) ([1654007](1654007))
@matticbot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.7.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jun 2, 2025
# [6.7.0](v6.6.4...v6.7.0) (2025-06-02)

### Bug Fixes

* **404-images:** use JS without modifying content ([#3963](#3963)) ([9f5646b](9f5646b))
* add missing namespace ([#3980](#3980)) ([6d58793](6d58793))
* **emails:** add missing HTML markup in the change-email-cancel template ([#3981](#3981)) ([040ae30](040ae30))
* **ga4:** fire login/registration activities via SSO ([#3965](#3965)) ([8c97515](8c97515))
* hide modal content gate when modal checkout is opened ([#3953](#3953)) ([a503973](a503973))
* **jetpack:** handle the related posts max age option ([#3964](#3964)) ([8aad2b8](8aad2b8))
* make sure fix duplcate fields apply filters ([#3971](#3971)) ([f361a4e](f361a4e))
* namespace Lite Site ([#3975](#3975)) ([e4665ae](e4665ae))
* prevent auto-publishing corrections when scheduling posts ([#4006](#4006)) ([7531832](7531832))
* sync correction status with parent post status ([#3978](#3978)) ([dcd5a12](dcd5a12))

### Features

* add compatibility to network in custom bylines ([#3972](#3972)) ([199a993](199a993))
* add icons repository and remove custom icons ([#3883](#3883)) ([e56d2e0](e56d2e0))
* **analytics:** "My Account" dashboard interactions ([#3949](#3949)) ([22e9590](22e9590))
* **donations:** update notice style and type ([#3962](#3962)) ([3f60ef3](3f60ef3))
* **email-change:** remove env constant requirement ([#3943](#3943)) ([4158bf1](4158bf1))
* **my-account:** apply Newspack UI styles to My Account w/ env constant ([#3951](#3951)) ([e4aa5a2](e4aa5a2))
* **my-account:** full-site takeover template and custom nav menu ([#3974](#3974)) ([5cf8403](5cf8403))
* **woocommerce:** log error notices ([#3952](#3952)) ([1654007](1654007))
@matticbot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants