-
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
Add subscription variation support to WooPay button #7884
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.26 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 don't think this is expected. I'm seeing the buttons on variable subscription products on
This is where the weirdness comes in. It will work fine with a normal variable subscription product. To reproduce, you'll need to grab the ID of the subscription variation and hardcode it here. This will simulate purchasing a Find the variation ID here:The product is initially added to the cart and the GPay modal might show the correct total, but then will update to 0 after. Reproducing the error will look like this:Let me know if you're still unable to reproduce it and I'll try my best to help. It's a strange thing. |
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.
Ah, nice catch! Sorry I didn't notice that in your screenshot. There's one JS test failing, but that's due to a different PR. I'll proceed with merging this one. |
Fixes #7588
Changes proposed in this Pull Request
This adds support for the
subscription_variation
product type to the WooPay button, similar to what's done for payment request buttons.Testing instructions
This covers an edge case and is a bit awkward to test. Variable Subscription products have the type,
variable-subscription
and the actual variations have the type,subscription_variation
. When navigating to a variable subscription product and purchasing a variation, the the express checkout buttons will seevariable-subscription
as the product type. There is some case in which a subscription variation can be purchased while not attached to it's parent product, at which point the product type will besubscription_variation
. Myself and others haven't been able to find a way to purchase a subscription variation via normal core flows.Instructions
$product_id
to the ID of the variation here. This will result in thatsubscription_variation
being added to the cart any time the WooPay or payment request button is used.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