• Resolved arunschandran

    (@arunschandran)


    I am getting a JS error like this

    jquery.yith-wcwl.js?ver=3.0.9:1 Uncaught TypeError: Cannot read property 'contains' of undefined
        at jquery.yith-wcwl.js?ver=3.0.9:1
        at NodeList.forEach (<anonymous>)
        at MutationObserver.observe.childList (jquery.yith-wcwl.js?ver=3.0.9:1)

    I saw many people mentioning the same error, but I couldn’t find the solution in any of those threads.

    I tried disabling all plugins except Woocommerece and YITH WooCommerce Wishlist and changing the theme. Then I found out I can see this error only if “Google tag manager” is present. I can’t disable Tag manager. Can you please help me to fix this error?

Viewing 2 replies - 16 through 17 (of 17 total)
  • I’m having he same issue and the files have expired. Where can I download them?

    Hello..,

    I am getting a JS error like this after 1st product added into cart from wish list page.

    jquery.yith-wcwl.js?ver=3.0.15:140 Uncaught TypeError: Cannot read property 'is_user_owner' of undefined
        at HTMLBodyElement.<anonymous> (jquery.yith-wcwl.js?ver=3.0.15:140)
        at HTMLDocument.dispatch (jquery.js?ver=1.12.4-wp:3)
        at HTMLDocument.r.handle (jquery.js?ver=1.12.4-wp:3)
        at Object.trigger (jquery.js?ver=1.12.4-wp:3)
        at HTMLBodyElement.<anonymous> (jquery.js?ver=1.12.4-wp:3)
        at Function.each (jquery.js?ver=1.12.4-wp:2)
        at n.fn.init.each (jquery.js?ver=1.12.4-wp:2)
        at n.fn.init.trigger (jquery.js?ver=1.12.4-wp:3)
        at Object.success (add-to-cart.js?ver=4.6.0:116)
        at i (jquery.js?ver=1.12.4-wp:2)

    I tried disabling all plugins except Woocommerece and YITH WooCommerce Wishlist and changing the theme but my issue is still persist. As i can see mentioned below JS in jquery.yith-wcwl.js file causes issue.

    t.on( 'added_to_cart', 'body', function( ev, fragments, carthash, button ){
                if( typeof button != 'undefined' && button.closest( '.wishlist_table' ).length ) {
                    typeof wc_add_to_cart_params !== 'undefined' && ( wc_add_to_cart_params.cart_redirect_after_add = cart_redirect_after_add );
                    typeof yith_wccl_general !== 'undefined' && ( yith_wccl_general.cart_redirect = cart_redirect_after_add );
    
                    var tr = button.closest('[data-row-id]'),
                        table = tr.closest('.wishlist-fragment'),
                        options = table.data('fragment-options');
    
                    button.removeClass('added');
                    tr.find('.added_to_cart').remove();
    
                    if ( yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart && options.is_user_owner ) {
                        tr.remove();
                    }
                }
            } );

    I update below code in plugin’s JS file
    if ( yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart && typeof options !== "undefined" && options.is_user_owner ) {
    and issue resolved. Can you please check and update JS code in your plugin so, i can’t have to modify plugin.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘JS error’ is closed to new replies.