Woocommerce Cart Block Fails on Older, Non-Block Enabled Themes
-
First, thank you to the developer(s) for a very nicely designed and functioning plugin.
Today, I uninstalled the previous reCAPTCHA-based login security plugin on several Woocommerce sites and set up Simple Cloudflare Turnstile. The plugin works well on all but the older, non-block-enabled Twenty Ten and Arcade Basic themes which were using the Cart Block. On those sites, when the Cart page was visited, all the user got was the spinning throbber and the Cart did not display.
It looks like the problem is a JavaScript conflict with the Cart Block on those themes:
Uncaught (in promise) TypeError: turnstileItem is null
unsubscribe https://thedomain.com/wp-content/plugins/simple-cloudflare-turnstile/js/integrations/woocommerce.js:28
r https://thedomain.com/wp-includes/js/dist/data.min.js:2
instantiate https://thedomain.com/wp-includes/js/dist/data.min.js:2
v https://thedomain.com/wp-includes/js/dist/data.min.js:2
k https://thedomain.com/wp-includes/js/dist/data.min.js:2
a Redux
U https://thedomain.com/wp-includes/js/dist/data.min.js:2
D https://thedomain.com/wp-includes/js/dist/data.min.js:2
s https://thedomain.com/wp-includes/js/dist/data.min.js:2
setTimeout handler*s https://thedomain.com/wp-includes/js/dist/data.min.js:2
i https://thedomain.com/wp-includes/js/dist/data.min.js:2
v https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
p https://thedomain.com/wp-includes/js/dist/data.min.js:9
__unstableMarkListeningStores https://thedomain.com/wp-includes/js/dist/data.min.js:2
a https://thedomain.com/wp-includes/js/dist/data.min.js:2
p https://thedomain.com/wp-includes/js/dist/data.min.js:9
Je https://thedomain.com/wp-includes/js/dist/data.min.js:9
Qe https://thedomain.com/wp-includes/js/dist/data.min.js:9
Ye https://thedomain.com/wp-includes/js/dist/data.min.js:9
v https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
b https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
React 11
i https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
l https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
l https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
a https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
d https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:33
u https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/wc-cart-checkout-base-frontend.js:1
8349 https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/cart-frontend.js:1
l https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/cart-frontend.js:1
n https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/cart-frontend.js:1
O https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/cart-frontend.js:1
<anonymous> https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/cart-frontend.js:1
<anonymous> https://thedomain.com/wp-content/plugins/woocommerce/assets/client/blocks/cart-frontend.js:1
woocommerce.js:28:17On other sites the Cart Block works just fine.
The workaround on the affected sites was to switch the Cart Page from the Cart Block to the Woocommerce Cart shortcode:
[woocommerce_cart]Using the shortcode, the JavaScript error didn’t occur and the Cart displays fine.
The Checkout Block appears to be working fine.
I’d like to be able to use the Cart Block and Simple Cloudflare Turnstile even on these old, non-block-enabled themes.
The topic ‘Woocommerce Cart Block Fails on Older, Non-Block Enabled Themes’ is closed to new replies.