We noticed recently that when someone pulls up our checkout form and submits it in a way that triggers a Square payment form validation error (e.g. “Enter a valid card number”), a Javascript error is triggered that breaks the checkout form and prevents WooCommerce checkout/cart validation from succeeding. The error is Unhandled Promise Rejection: ReferenceError: Can't find variable: wc_cart_fragments_params and comes from wc-square.min.js. If the payment information is property filled in, checkout/cart validation proceeds as expected.
This happens with the latest version of the plugin as well as past versions back to at least 3.7.1, so we believe it may be because of a conflict introduced in some more recent version of the square payment form JS.
I was able to reproduce the error on a vanilla installation of WordPress, with just WooCommerce, WooCommerce Square and a default theme with a simple product, all using the latest versions of everything. Hitting “Place Order” with an empty payment form triggers a Square validation error and breaks the page; no other input or user action is available after that and the checkout process is halted.
Thank you for reaching out and providing a detailed explanation of the issue you are experiencing.
From your description, it does appear that there may be a compatibility issue with the Square payment JS when a form validation error is triggered. I can confirm this is something that should not occur under normal circumstances.
For better assistance, please provide us with the following:
1. A screenshot of the console with the Javascript error. 2. Please provide a copy of your System Status Report, found under WooCommerce > Status, on your site.
Once we have this information, we can work on diagnosing the root cause of the problem and hopefully establish a solution.
Thank you so much for reporting this! I was able to reproduce it, on a test installation of mine, and wanted to inform you that I filled a bug report about it.
We appreciate you being an active part of the community 🙂
Have a wonderful day!
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Payment form validation breaks checkout error display’ is closed to new replies.