Hello,
Here’s an alternative method to implement the same fix concept, that is, force-showing the postal code field in the square CC checkout “new card” option so that the user can see whether or not it auto-filled the zip code from the billing section. This should override the plugin’s CSS since it does not use !important
. Note that both Display and Visibility CSS properties were set to hide the field initially.
Paste this right into your “Added CSS” menu in the theme customizer for A QUICK fix.
body .woocommerce #payment div.payment_method_square_credit_card .wc-square-credit-card-card-postal-code-parent.hidden {
display: inline-block !important;
visibility: visible !important;
}
It is generally ill-advised to edit plugin files directly, as your changes will not persist beyond the next update, and making mistakes can cause bad breakage, so this is a better option.
NOTE: This is a fix for the symptom, not the cause. For some reason Javascript updates of the hidden postal code field (copying in from the billing address field) seems to be failing, thus leaving that required square field empty. This needs to be fixed in WooCommerce Square Checkout plugin for a true fix to the root of the problem. It should be highest priority, since it breaks Payment during checkout, the worst possible place to have a bug.
Fix Suggestions:
The root issue may be fixed if it’s just rewritten slightly to avoid jQuery conflicts, or javascript conflicts, etc, in case field event handlers aren’t firing or js errors are preventing the field updates. Another fix option would be to run a timer in pure simple javascript without any jQuery etc that ensures the fields are synced constantly (twice a second or something would probably suffice). It’s again not a root cause fix, but, it would future-proof and fix checkout for various future potential conflicts, so that no matter what breaks the field update, it’s got a way to auto-fix it at runtime as a backup parachute. Just some thoughts.
In any case, hopefully WooCommerce Square plugin dev team puts out a patch update soon for this in the Square plugin, this directly negatively impacts sales and hurt one client’s conversion ratio noticeably. In the mean time… at least this takes the mystery out of why some people cannot check out!