Payment form validation breaks checkout error display
-
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 fromwc-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.
- The topic ‘Payment form validation breaks checkout error display’ is closed to new replies.