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

fix: add check for newsletter modal and fix typo #3727

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

laurelfulford
Copy link
Contributor

@laurelfulford laurelfulford commented Feb 5, 2025

All Submissions:

Changes proposed in this Pull Request:

This PR makes sure that the content gate doesn't refresh the page after purchases before the reader can run through the newsletter sign up step of the checkout.

It also fixes a small typo in the openNewslettersSignupModal() config settings (changing Dissmiss to Dismiss). This doesn't appear to be used anywhere else yet, but I'd appreciate confirmation!

See: 1200550061930446-as-1209271919879010

How to test the changes in this Pull Request:

A lot of the preliminary testing setup is the same as Automattic/newspack-blocks#2044, so it may make sense to test these together!

  1. Set up a Membership plan that restricts content.
  2. Create two products to use to purchase access to the Membership plan: one simple subscription, and one variable subscription.
  3. Enable the Membership Content Gate under Newspack > Engagement > Advanced Settings, and add two checkout button blocks, one for the simple subscription product that can purchase the membership, and one for the variable subscription product that can purchase the membership.
  4. Under Newspack > Engagement > Advanced Settings, enable "Present newsletter signup after checkout and registration".
  5. In an incognito window, trigger the Content Gate, and purchase a membership using the Simple Subscription product. When you get to the Newsletter sign up step, give it a moment; the post will refresh before the newsletter form is submitted or closed.
  6. Apply this PR.
  7. Repeat step 4; confirm that the Newsletter sign up form remains open.
  8. In a new incognito window, sign up for a RAS account, and sign up for all newsletters.
  9. Repeat step 4; confirm that the Newsletter sign up form is not triggered, and that the post refreshes after the purchase is completed so the Content Gate is no longer visible.

Bonus testing:
10. If you're testing with Automattic/newspack-blocks#2044, repeat step 4, but purchase the membership with the variable subscription. Confirm that the newsletter form doesn't refresh until you've submitted it/closed it.
11. In a new incognito window, repeat steps 7 and 8; for the latter, use the variable subscription product to purchase the membership. Confirm that the newsletter sign up form is not shown, and that the post refreshes to hide the Content Gate.

Smoke testing
12. Run through a few regular checkouts in incognito windows. Subscribe to different newsletters, and confirm they are removed from the list when you repeat the email address, and that the newsletter prompt disappears entirely once you've signed up for all.

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 Feb 5, 2025
@laurelfulford laurelfulford marked this pull request as ready for review February 5, 2025 19:38
@laurelfulford laurelfulford requested a review from a team as a code owner February 5, 2025 19:38
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described!

@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 Feb 6, 2025
@laurelfulford
Copy link
Contributor Author

Thanks @dkoo!

@laurelfulford laurelfulford merged commit 5fdcab6 into trunk Feb 7, 2025
9 checks passed
Copy link

github-actions bot commented Feb 7, 2025

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 Feb 7, 2025
## [5.13.2-alpha.1](v5.13.1...v5.13.2-alpha.1) (2025-02-07)

### Bug Fixes

* add check for newsletter modal and fix typo ([#3727](#3727)) ([5fdcab6](5fdcab6))
* check for WC as well as WCS ([#3720](#3720)) ([f91803a](f91803a))
* make the cart, checkout pages use shortcodes on install ([#3699](#3699)) ([954e01b](954e01b))
* update corrections post type slug ([#3702](#3702)) ([5f100ba](5f100ba))
@matticbot
Copy link
Contributor

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

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 [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.

4 participants