-
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
Do not allow guest users to buy subscriptions with WooPay Direct Checkout #9792
base: develop
Are you sure you want to change the base?
Do not allow guest users to buy subscriptions with WooPay Direct Checkout #9792
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.39 MB ℹ️ View Unchanged
|
8667c9e
to
2626806
Compare
@@ -196,6 +196,9 @@ public function ajax_get_shipping_options() { | |||
public function ajax_get_cart_details() { | |||
check_ajax_referer( 'wcpay-get-cart-details', 'security' ); | |||
|
|||
// Process added gift cards. | |||
add_filter( 'woocommerce_gc_disable_ui', '__return_false' ); |
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.
While working on #9846 I noticed the express checkout buttons (Apple/Google Pay) were not getting hidden on classic checkout when the cart total get to 0 by adding gift cards, as the PR was closed I'm taking the opportunity of this PR to add this line and fix that.
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.
Can you provide test instructions?
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.
@hsingyuc Testing instructions:
- Install Gift Cards.
- Create new Gift Card codes.
- Expose your site with Jurassic Tube or ngrok to enable Google/Apple Pay buttons.
- Add products to the cart.
- Access the classic checkout page.
- Add gift card codes until the total cart value reach 0.
- The Google/Apple Pay buttons should be hidden.
@@ -196,6 +196,9 @@ public function ajax_get_shipping_options() { | |||
public function ajax_get_cart_details() { | |||
check_ajax_referer( 'wcpay-get-cart-details', 'security' ); | |||
|
|||
// Process added gift cards. | |||
add_filter( 'woocommerce_gc_disable_ui', '__return_false' ); |
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.
Can you provide test instructions?
includes/class-wc-payments.php
Outdated
if ( ! self::$woopay_util->should_enable_woopay_on_cart_or_checkout() ) { | ||
return; | ||
} | ||
|
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 code makes sense to me but I still can not reproduce the issue. Can you check my recording and see if anything I missed? Thank you!
Screen.Recording.2024-12-11.at.12.27.43.PM.mov
@alefesouza I can reproduce the issue if not in incognito. I'll approve this PR after testing Screen.Recording.2024-12-11.at.12.42.33.PM.mov |
@alefesouza could you double check with your PR, can you still use direct checkout on simple product(not subscription)? Screen.Recording.2024-12-11.at.1.03.54.PM.mov |
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.
Should we also consider that if there's one simple product and one subscription in the cart, remove the subscription product and we should be redirectd to WooPay?
Fixes #9791
Changes proposed in this Pull Request
This PR fixes guest users being able to buy subscriptions using WooPay via Direct Checkout.
Testing instructions
Proceed to Checkout
button.Proceed to checkout
button.Proceed to Checkout
button.Proceed to checkout
button.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