-
Notifications
You must be signed in to change notification settings - Fork 43
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: support new is_my_account() method from main plugin #1869
Conversation
includes/class-modal-checkout.php
Outdated
empty( $modal_checkout_url ) || | ||
( | ||
// Until we use the modal checkout flow from My Account, we don't want to show the modal checkout thank you template for checkouts originating from My Account. | ||
method_exists( 'Newspack\WooCommerce_My_Account', 'is_from_my_account' ) && \Newspack\WooCommerce_My_Account::is_from_my_account() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When following the testing instructions, the successful result is never referred from my-account, but from /checkout. That might be why I'm not seeing what's expected here: Automattic/newspack-plugin#3389 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hidden field added here should account for that. However, it won't work for express checkouts, and I'm not sure how we might pass that info along to express checkout requests...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 146917f
Marking approved based on @adekbadek's approval in the other PR. |
## [4.1.1](v4.1.0...v4.1.1) (2024-09-16) ### Bug Fixes * support new is_my_account() method from main plugin ([#1869](#1869)) ([b9a3aba](b9a3aba))
🎉 This PR is included in version 4.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [4.2.0-alpha.2](v4.2.0-alpha.1...v4.2.0-alpha.2) (2024-09-16) ### Bug Fixes * support new is_my_account() method from main plugin ([#1869](#1869)) ([b9a3aba](b9a3aba))
🎉 This PR is included in version 4.2.0-alpha.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
New bug posted here: Automattic/newspack-plugin#3426 |
All Submissions:
Changes proposed in this Pull Request:
Currently, transactions completed from the "My Account" dashboard are not using the modal checkout flow. However, due to a fix in #1573 for express checkout flows, when completing a transaction from My Account that's also related to a subscription that originated with a modal checkout flow, these transactions are flagged as My Account transactions and show the modal checkout thank you template, but in a non-modal context, trapping the user in a dead-end.
This fix relies on a new method in Automattic/newspack-plugin#3389 that lets us determine if a checkout flow originated from My Account, and show the correct non-modal thank you template if so.
The better solution would be to use the modal checkout flow for My Account transactions too, but this is a bigger change than is appropriate for a hotfix.
How to test the changes in this Pull Request:
See testing instructions in Automattic/newspack-plugin#3389.
Other information: