-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: redesign modal checkout #1602
Conversation
@miguelpeixe let's base redesign work from the |
Getting started with testing and reviewing this (finally! sorry for the delay). But I have an answer to one of your questions!
I ran into this same issue on #1626. The fix is to put both CSS selectors on the same line, like this. #checkout_continue, #place_order { /* stylelint-disable-line */ |
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 went through all testing steps and everything is mostly working! 🙌
Before I do a more thorough code review I ran into a couple of minor things so far:
- When checking the "I’d like to cover the 3.6% transaction fee" option, the transaction total is updated at the top of the modal, but not in the Transaction Details summary's total (the order amount is correct once placed, though).
- If taxes are not enabled and no coupons are applied, when purchasing a shippable product with either multiple available shipping methods and/or only paid shipping methods, the Transaction Details summary is not shown. This results in a strange modal state where the totals don't match up (this should be fixed by feat(ras-acc): support shipping, custom fields, and order notes in modal checkout #1626, though, so maybe there's nothing needed for this PR):

More testing and a line-by-line code review to come!
Thank you for taking this review, @dkoo!
Fixed in the Automattic/newspack-plugin#2805 (Automattic/newspack-plugin@6ff7dd0).
The mentioned PR doesn't seem to tweak the rules for when to render the order review table, so I added in e00793f
😌 updated in fc748a2 |
Update regarding the cover fee issue: Automattic/newspack-plugin#2805 (comment) |
But it uses |
Ah, I missed that. I think my brain was looking for a one-liner 😅 . I'll revert my change and allow your PR to handle those requirements. |
This reverts commit e00793f.
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.
Looking good! Issues and solutions in separate PRs noted. I think this is a fantastic foundation for the redesigned modal checkout experience, and it lays the foundation for a lot of great work to come!
Tested with one-time donations, recurring donations, non-donation purchases (one-time and subscriptions), variable subscriptions, and shippable products. Couldn't break it.
🎉 This PR is included in version 3.0.0-epic-ras-acc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.1.0-epic-ras-acc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.2.0-epic-ras-acc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.3.0-epic-ras-acc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
1205234045751551-as-1205933702651188
Implements a redesigned and new 2-step strategy for the modal checkout.
The modal checkout class no longer performs form validation, it now uses
woocommerce_checkout_update_totals
so it validates through Woo without having to place the order. By validating through Woo, the modal checkout should natively support any custom field combination Woo and its extensions may use. This new strategy also uses XHR instead of a regular form submission, which should provide a better and faster experience for the reader.To also increase support for core Woo checkout functionality, the functional aspects of the modal checkout were moved from the template file to hooks. This allows the template file to be modified/updated without impacting the requirements that allow the checkout to function in a modal. The new
src/modal-checkout/templates/form-checkout.php
is now intentionally very similar to Woo's original template file.A significant part of the work here has been around
src/modal-checkout/index.js
, to allow the new 2-step approach to work as the design proposes. Some important parts are:woocommerce_checkout_update_totals
parameter).Known issues
/* stylelint-disable-line */
. Not sure how to deal with this.Subscription
One-time donation
Recurring donation
Recurring donation (known customer with known card)
Shippable product
Field validation
How to test the changes in this Pull Request:
Other information: