form.get() js error when PayPal Checkout is enabled
-
When I have PayPal Checkout enabled as a payment option, I get the following JS error on my customized single product’s page console:
TypeError: form.get(…) is undefined wc-gateway-ppec-generate-cart.js:46:23
I think the reason is because I am using a custom single-product template, which does not include the paypal checkout form on it, and I see in the JS code, it is searching for a form that does not exist. I could just disable paypal checkout, but the problem is that I like to have it on the review order screen, just not the single product screen. Is there any way to prevent the JS from checking the single-product screen, without modifying the plugin’s JS file?
Right now I have to disable PayPal Checkout, or else JS optimization through Autoptimize fails, due to this issue.
I feel like this plugin should have a basic if check before executing this code (i.e., if form.length > 0 …)
- The topic ‘form.get() js error when PayPal Checkout is enabled’ is closed to new replies.