-
Notifications
You must be signed in to change notification settings - Fork 685
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 page level error and disable checkout button when no available payment methods #2873
Display page level error and disable checkout button when no available payment methods #2873
Conversation
Sync develop
…ll available payment methods while fetching cart data on checkout page
… available for available methods
|
[PWA-633] My Account: Address Book: Main View (magento#2857)
Sync updated from develop
…nected queries to peregrine.
…eckoutPageOperations" in useCheckoutPage.js peregrine component
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.
Hey @ankurvr, thanks for the contribution. Nice work.
I have outlined a couple of minor changes but the overall code looks good.
Please do update the merge conflicts.
packages/peregrine/lib/talons/CheckoutPage/__tests__/useCheckoutPage.spec.js
Show resolved
Hide resolved
I'm looking into the first issue Dev posted. |
// If we don't have an implementation for a method type, ignore it. | ||
const isPaymentAvailable = !!availablePaymentMethods.find(({ code }) => | ||
paymentMethods.includes(code) | ||
); |
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.
If zero total checkout is enabled, and a user or coupon causes the total to be $0, then code
will be free
. As we don't have a payment implementation view for this, we just need to allow the code free
to mean that payment is available. Making the below changes allows checkout to proceed when a user has entered a coupon/gc that causes the total to be zero.
// If we don't have an implementation for a method type, ignore it. | |
const isPaymentAvailable = !!availablePaymentMethods.find(({ code }) => | |
paymentMethods.includes(code) | |
); | |
// If we have an implementation, or if this is a "zero" checkout, | |
// we can allow checkout to proceed. | |
const isPaymentAvailable = !!availablePaymentMethods.find( | |
({ code }) => code === 'free' || paymentMethods.includes(code) | |
); |
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.
However, in addition to this change, we may want to change the copy here. free
will only be the code when a GC/coupon is entered causing the total to be zero.
That means if a user gets to checkout page before adding a gift card or coupon they will first see the error messaging. So we might want to update the message to explain this somehow. cc @schensley
@dpatil-magento Please suggest right veriant from below.
|
@ankurvr Good catch on the difference. This is because there are now two errors being rendered that look similar but are different components. Please update the |
@sirugh Noted. I will do needful. |
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.
Thank you for fixing the styling!
Fixed issue #2869 Assigned by @sirugh
Description
Display page level error and disable checkout button when no available payment methods
Related Issue
Closes #2869.
Acceptance
Verification Stakeholders
Specification
Verification Steps
Screenshots / Screen Captures (if appropriate)
Checklist