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: remove OneSignal script from the modal checkout #2029

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

laurelfulford
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

The OneSignal signup bell shows in the modal checkout; it shouldn't be loaded there.

See 1200550061930446-as-1209206364302813

How to test the changes in this Pull Request:

  1. Install the OneSignal plugin and sign up for a free account.
  2. Connected the account to your site (you have to fill out some forms and the site's URL, then copy the OneSignal App ID and OneSignal REST API Key to the WP Admin > One Signal page on your website.
  3. In your OneSignal account, navigate to Settings > Push Platforms > Web, and add a Subscription Bell prompt under "Permission Prompt Setup".
  4. View your site and confirm you have the little Subscription bell in the bottom right corner.
  5. Run through a checkout using the modal checkout, and confirm the bell also appears there:

CleanShot 2025-01-22 at 12 25 45

  1. Apply this PR.
  2. Repeat steps 4-5 and confirm the bell still shows on regular pages, but not in the modal checkout.

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?

@@ -947,6 +947,16 @@ public static function remove_hooks() {
]
);
}
if ( is_plugin_active( 'onesignal-free-web-push-notifications/onesignal.php' ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to check for the active plugin here... if it's not, the hook will not be registered, nothing will be removed, and everything will be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good call, thanks @leogermani! I removed this check in 20f00c7 🙂

@laurelfulford
Copy link
Contributor Author

Thanks @leogermani!

@laurelfulford laurelfulford merged commit 343ca5e into trunk Jan 30, 2025
9 checks passed
@laurelfulford laurelfulford deleted the fix/remove-onesignal-from-modal branch January 30, 2025 18:45
Copy link

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! ❤️

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

Successfully merging this pull request may close these issues.

2 participants