-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fixes "Invalid recurring shipping method" errors when purchasing multiple subscriptions with Apple / Google Pay #8618
Fixes "Invalid recurring shipping method" errors when purchasing multiple subscriptions with Apple / Google Pay #8618
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.23 MB ℹ️ View Unchanged
|
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.
I could not reproduce the Invalid recurring shipping method.
error in develop, but I got a generic error message on the Apple Pay modal, and it is fixed by this branch, so I believe they are the same.
I tried testing this along with a trial subscription, but the button is not displayed when there's a trial subscription in the cart.
Also, while testing I got this error. This is not related to this PR, but do you know if this is expected?
Thanks @gpressutto5 for the review and test.
That's interesting. I just installed a fresh JN site and was able to reproduce it so not sure why you weren't able to get the error 🤔 There might be more steps that I didn't include in the PR description which are necessary to reproduce the issue like, making sure you have at least 2 shipping options available (free and flat rate).
This is expected :) Since the release branch has already been created, I'll merge this into Thanks! |
…iple subscriptions with Apple / Google Pay (#8618)
…iple subscriptions with Apple / Google Pay (#8618)
Fixes #8029
Relevant slack thread: p1712735606268559-slack-C7U3Y3VMY
Supersedes #8602
Changes proposed in this Pull Request
When attempting to purchase multiple subscriptions of varying periods with Apple/Google Pay, you will get an "Invalid recurring shipping method." error:
This issue is caused by our
get_shipping_options()
function wiping the chosen shipping methods when it recalculates shipping packages and available shipping methods, and then when Woo Subscriptions validates the checkout data onprocess_checkout
, it throws an error because the recurring shipping methods are no longer set.This PR fixes these issues by restoring any chosen shipping methods that were wiped which belong to a recurring cart.
Testing instructions
develop
when you click on the Pay button, you will be hit with a checkout error:npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge