-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix/12: reposition error notice on classic checkout page #242
Conversation
@MiguelAxcar Thanks for the PR. QA update:
|
Hello @qasumitbagthariya . Thanks for testing this feature and giving detailed feedback. The expected outcomes of this change are:
Commenting your screenshots: TT4 - Classic checkoutBased on your screenshot, seems that the feature is working as expected - you're actually on Classic Checkout Page, and the error message the error message is being displayed above the payment. By the screenshot I also assume that the page scrolled to the error notice, as it's on top of the screen. TT4 - Block checkoutBased on your screenshot, I can see no changes on this screen - error notice being displayed at the top of the page. I also assumed that the page scrolled to the error notice, i.e., keeping the current functionality untouched. Storefront - Classic checkoutBased on your screenshot, seems that this is the Block Checkout page for Storefront, and not Classic Checkout Page. May you please check? Here's how both pages looks on my end: Storefront Classic Checkout page (on my end)Storefront Block Checkout page (on my end)I'll be ready for provide any further needed information. Thank you! |
QA update: ✅@MiguelAxcar Thanks for the details comment I have verify with different theme and size, it's looks good to me Testing Environment
Steps to Test- As mentioned in the PR description.
|
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.
Code looks good and behaves as expected! 🚢
All Submissions:
Changes proposed in this Pull Request:
This PR addresses the issue where payment gateway specific error messages are displayed out of context on the checkout page, improving the user experience by making error handling more intuitive and context-specific.
Initially, the idea was to highlight invalid fields in red, but this approach was not feasible due to the fields being embedded within an
iframe
hosted by Square. Limitations such as cross-origin restrictions and security concerns made this approach impractical.The proposed solution ensures that error messages are repositioned near the payment method form, rather than appearing at the top of the page. This fix is specifically designed to work with the Classic Checkout Page.
This solution also overrides WooCommerce's default behavior of scrolling to the top of the page upon encountering errors. Instead, it scrolls to show the alert box only if any part of it is not visible within the viewport.
Additionally, it ensures that the Square credit card payment method is selected before repositioning the alert.
Closes #12.
Steps to test the changes in this Pull Request:
We aim to verify the repositioning of error notices on the Classic Checkout Page when using the Square Credit Card payment method.
Local environment setup
npm run build:dev
before testing as this pull request changed JavaScript source code, affecting build artifacts.Testing steps
Activate Square credit card payment method
Enable "Detailed Decline Messages"
Create an order
Open the classic checkout page
Choose Square Credit Card as the payment method
Fill in credit card data to generate errors
Verify error message behavior
Confirm scrolling behavior
Test with different themes
Expected outcome
(Ensure the error notice is shown near the payment fields and the page scrolls to it when no part of it is visible when placing the order)
Changelog entry