-
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
Display express payment buttons on checkout blocks pay-for-order page #7570
Display express payment buttons on checkout blocks pay-for-order page #7570
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: +6 B (0%) Total Size: 1.44 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.
Thanks @hsingyuc This tests well. Left a comment on the order of logic but it's nothing major and you can disregard it if you'd like.
if ( $this->is_pay_for_order_page() ) { | ||
return true; | ||
} | ||
|
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.
nit: I feel like it would be more appropriate to update the logic in line 541 to exclude pay-for-orders instead of a top-level return true
. Excluding the pay-for-order page in line 541 would make it easier to reason out the logic.
It will also match the existing pattern of this function, where we bail out if conditions are met and only return true at the very end.
That said, I don't have any strong objections to the current implementation.
Suggested change for line 541 instead of above:
( ! $this->is_product() && ! $this->is_pay_for_order_page() && 0.0 === (float) WC()->cart->get_total( 'edit' ) ) ||
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.
Good idea! Updated here ab2c28f.
Changes proposed in this Pull Request
When the page has blocks we don't initialize the express payment buttons, so if it's a pay-for-order page but the checkout page uses blocks, we won't see the express payment buttons even though pay-for-order never shows the checkout blocks. This PR adds the logic to display the buttons on pay-for-order pages when the checkout page is using checkout blocks.
Design discussion in this PR.
Testing instructions
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