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
In out-of-stock single product pages: Uncaught TypeError #558
Comments
Having the same issue here. Since we have a newsletter sign up form in the footer it won't show up on product pages that are out of stock. |
Same issue is happening with us, however, all products are having this error. |
When using a plugin like Autoptimize to concatenate JavaScript, this can cause all scripts to fail. Adding wc-gateway-ppec-generate-cart.js to the exclusions list will resolve that issue, but the error still appears in the console. |
Currently, when on a product page containing an item that is out of stock, both wc-gateway-ppec-smart-payment-buttons.js and wc-gateway-ppec-generate-cart.js scripts throw exceptions as both scripts are trying to target elements which don't exist when products are out of stock. This PR adds a check for the relevant form element, and returns early if it is not present. Fixes #558
I had a minification plugin (Asset CleanUp: Page Speed Booster) and it was causing this issue. |
This error does not affect the operation but it should be fixed.
Steps to replicate the issue
What expected
No error in the browser console.
Environment
Addtional context
https://wordpress.org/support/topic/uncaught-typeerror-checkvalidity-when-product-is-out-of-stock/
The text was updated successfully, but these errors were encountered: