-
Notifications
You must be signed in to change notification settings - Fork 69
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
JS error breaking checkout CC form (shortcode checkout) #3175
Comments
Looks like that JS error is firing from payment request code woocommerce-payments/client/payment-request/index.js Lines 187 to 189 in f4f9491
Though the issue seems to be that my site doesn't have |
The code in @haszari's screenshot is not from WooCommerce Payments. It's from Jetpack code instead: wc_enqueue_js(
"
// wcpay.payment-request.availability event gets fired twice.
// make sure we push only one event.
var cartItem_{$cart_item_key}_logged = false;
wp.hooks.addAction('wcpay.payment-request.availability', 'wcpay', function(args) {
if ( true === cartItem_{$cart_item_key}_logged ) {
return;
}
var properties = {$properties};
properties.express_checkout = args.paymentRequestType;
_wca.push(properties);
cartItem_{$cart_item_key}_logged = true;
});
"
); It was added in this PR Automattic/jetpack#20812 cc @moon0326 as you are the author of this PR, and @haszari you're the reviewer :D. |
The proper way should be just That said, I can not replicate this issue on my testing site with my build using Here is my test site info 2a870-pb. Screenshot shows that CC field is showing OK: NOTE: to have this script in the HTML source, there are a few conditions:
NEXT: |
Describe the bug
With latest build of
develop
, the credit card form doesn't render on checkout. Looks like a JS error is halting JS and preventing the form from being rendered.WCPay card form looks like this (with my current theme):
JS error
Uncaught TypeError: Cannot read properties of undefined (reading 'addAction')
:This might be an issue with my build, I used these commands:
npm install
composer install
npm run build:release
To Reproduce
Desktop (please complete the following information):
Reproduced on Safari, Chrome, Firefox on macOS.
Additional context
The text was updated successfully, but these errors were encountered: