Archived topic
Theme conflicting with Jetpack and WooCommerce
1 reply · Started by ustar on December 7, 2022
Hi there!
I noticed errors on the checkout page.
In the browser console:
Uncaught TypeError: e is undefined
L https://149391087.v2.pressablecdn.com/wp-content/plugins/gp-premium/menu-plus/functions/js/offside.min.js?ver=2.2.2:1
a https://149391087.v2.pressablecdn.com/wp-content/plugins/gp-premium/menu-plus/functions/js/offside.min.js?ver=2.2.2:1
getOffsideInstance https://149391087.v2.pressablecdn.com/wp-content/plugins/gp-premium/menu-plus/functions/js/offside.min.js?ver=2.2.2:1
getInstance https://149391087.v2.pressablecdn.com/wp-content/plugins/gp-premium/menu-plus/functions/js/offside.min.js?ver=2.2.2:1
<anonymous> https://149391087.v2.pressablecdn.com/wp-content/plugins/gp-premium/menu-plus/functions/js/offside.min.js?ver=2.2.2:1
It appears that theme is conflicting with Jetpack and WooCommerce.
Specifically, jQuery is being loaded after certain scripts -- which rely on jQuery -- like the following.
<script id='wc-cart-fragments-js-after'>
jQuery( 'body' ).bind( 'wc_fragments_refreshed', function() {
var jetpackLazyImagesLoadEvent;
try {
jetpackLazyImagesLoadEvent = new Event( 'jetpack-lazy-images-load', {
bubbles: true,
cancelable: true
} );
} catch ( e ) {
jetpackLazyImagesLoadEvent = document.createEvent( 'Event' )
jetpackLazyImagesLoadEvent.initEvent( 'jetpack-lazy-images-load', true, true );
}
jQuery( 'body' ).get( 0 ).dispatchEvent( jetpackLazyImagesLoadEvent );
} );
</script>
This occurs even with all Jetpack modules deactivated.
I have the latest versions of theme (3.2.4) and GP Premium (2.2.2)
Please, help me to fix the issue.
Thanks in advance.
Regards, Makarov.
Hi there,
something has moved the loading of the jQuery and its dependent files from the <head> to the footer.
Any jQuery dependent script that is fired before that loads will now break. By default WP loads jQuery in the head for this reason.
Here is the html for the core jquery script loading on your site:
<script data-wpacu-script-handle="jquery-ui-core" defer="" src="https://149391087.v2.pressablecdn.com/wp-includes/js/jquery/ui/core.min.js?ver=1.13.2" id="jquery-ui-core-js"></script>
Maybe the data-wpacu-script-handle and the pressablecdn.com will provide some ideas as to what is moving them.