-
Notifications
You must be signed in to change notification settings - Fork 216
Improve ECE compatibility with One Page Checkout #4757
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
Conversation
daledupreez
left a comment
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.
Functionally, this is working as described. I also tested the situation where express checkout is enabled in the product page and checkout, and confirmed that we're still showing only the express checkout buttons in the One Page Checkout section and not in the main product section. I also smoke tested loading an ECE modal from the button without One Page Checkout active, and that was clear, as were the related e2e tests -- there were some ACH failures, but those are being worked on in a dedicated PR.
However, I think there are some test-related improvements we can make, or at least discuss before we merge this PR.
tests/phpunit/PaymentMethods/WC_Stripe_Express_Checkout_Helper_Test.php
Outdated
Show resolved
Hide resolved
tests/phpunit/PaymentMethods/WC_Stripe_Express_Checkout_Helper_Test.php
Outdated
Show resolved
Hide resolved
includes/payment-methods/class-wc-stripe-express-checkout-element.php
Outdated
Show resolved
Hide resolved
includes/payment-methods/class-wc-stripe-express-checkout-element.php
Outdated
Show resolved
Hide resolved
includes/payment-methods/class-wc-stripe-express-checkout-helper.php
Outdated
Show resolved
Hide resolved
includes/payment-methods/class-wc-stripe-express-checkout-helper.php
Outdated
Show resolved
Hide resolved
tests/phpunit/PaymentMethods/WC_Stripe_Express_Checkout_Element_Test.php
Outdated
Show resolved
Hide resolved
tests/phpunit/PaymentMethods/WC_Stripe_Express_Checkout_Helper_Test.php
Outdated
Show resolved
Hide resolved
tests/phpunit/PaymentMethods/WC_Stripe_Express_Checkout_Helper_Test.php
Outdated
Show resolved
Hide resolved
diegocurbelo
left a comment
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 changes look good and work as described.
daledupreez
left a comment
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.
Thanks for the updates to the tests! 🚢
tests/phpunit/PaymentMethods/WC_Stripe_Express_Checkout_Element_Test.php
Outdated
Show resolved
Hide resolved
Co-authored-by: daledupreez <[email protected]>
Fixes STRIPE-743
Changes proposed in this Pull Request:
This PR improves the compatibility between Stripe Express Checkout (ECE) buttons and the WooCommerce One Page Checkout (OPC) plugin.
Problem:
When using the OPC plugin with ECE configured to show only on "checkout pages":
is_checkout()returnsfalse(they're technically product pages)Changes proposed:
is_wcopc_checkout()and treat them as checkout context rather than product contextTesting instructions
Prerequisites
Test Case 1: ECE shows on OPC with checkout location enabled
Test Case 2: Correct pricing with discount codes on OPC
Optional:
Test for regressions with OPC disabled.
CleanShot.2025-11-03.at.12.11.26.mp4
Changelog entry
Changelog Entry Comment
Comment
Post merge