Conflict/ bug in etheme.js - by Royalty - on WordPress WooCommerce support

This topic has 21 replies, 3 voices, and was last updated 6 years, 12 months ago ago by Olga Barlow

  • Avatar: Royalty
    Royalty
    Participant
    April 16, 2017 at 23:11

    Hello,
    I am using the plugin “Popup Maker” and since I updated Royal to version 3.0, this plugin doesnt work anymore – the popups (triggered by click) dont show up anymore.

    Chrome console shows the following error:

    Uncaught TypeError: Cannot read property 'length' of null
        at HTMLFormElement.<anonymous> (etheme.js:1439)
        at HTMLFormElement.dispatch (jquery.js:3)
        at HTMLFormElement.r.handle (jquery.js:3)
        at Object.trigger (jquery.js:3)
        at Object.a.event.trigger (jquery-migrate.min.js:2)
        at HTMLFormElement.<anonymous> (jquery.js:3)
        at Function.each (jquery.js:2)
        at a.fn.init.each (jquery.js:2)
        at a.fn.init.trigger (jquery.js:3)
        at HTMLFormElement.e.onFindVariation (add-to-cart-variation.min.js:1)

    If I disable etheme.js, the popups are shown. So this means that there is a conflict or a bug in etheme.js and any help how to fix this would be really appreaciated.

    20 Answers
    Avatar: Royalty
    Royalty
    Participant
    April 17, 2017 at 21:20

    In etheme.js, this part of the code (line 1416) causes the conflict:

         // **********************************************************************// 
        // ! Product variations images
        // **********************************************************************// 
    
        $('form.variations_form').on( 'found_variation', function( event, variation ) {
    
            var $variation_form = $(this);
            var $product        = $(this).closest( '.product' );
            var $product_img    = $product.find( '.woocommerce-main-image img:eq(0)' );
            var $product_link   = $product.find( '.woocommerce-main-image' );
            var $lighbox_link   = $product.find( '.product-lightbox-btn' ).first();
    
            var o_src           = $product_img.attr('data-o_srcset');
            var o_title         = $product_img.attr('data-o_title');
            var o_href          = $product_link.attr('data-o_src');
    
            var variation_image = variation.image.src;
            var variation_link = variation.image.url;
            var variation_title = variation.image.title;
    
            $product_link.attr('href', variation_image);
                        
            if ($('.main-images').hasClass('zoom-enabled')) {
                if($(window).width() > 768 && variation_image.length > 5 && variation_link.length > 5){
                    try {
                        $product_link.swinxyzoom('load', variation_image,  variation_link);
                    } catch(e) {}
                    
                }
                $product_link.attr('href', variation_link);
    
                if(variation_link.length > 5) $('.sxy-zoom-viewport img').first().attr('src', variation_image);
                if(variation_link.length > 5) $lighbox_link.attr('href', variation_link);
            } else {
                $product_link.attr('href', variation_link);
                if( variation_image.length > 5 ) $( '.woocommerce-main-image img' ).first().attr( 'src', variation_image );
                if( variation_image.length > 5 ) $( '.woocommerce-main-image img' ).first().attr( 'srcset', variation_image );
            }
    
            var owlMain = jQuery(".main-images").data('owlCarousel');
            if( typeof owlMain != 'undefined') {
                owlMain.goTo(0);
            }
    
        }) 

    If I delete it, it works. But of course I dont want to delete it but to fix it properly…

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 18, 2017 at 08:36

    Hello,

    Please wait for the theme update, it will be fixed.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 18, 2017 at 16:16

    Are you sure it will fix the conflict with the popup plugin? Can you give me an ETA? I have to decide if I can wait or downgrade…thank you

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 19, 2017 at 15:27

    Hello,

    Please try to reupload etheme.js file that we’ve sent to your email address.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 20, 2017 at 13:48

    I just reuploaded the file you sent me (thank you) but the bug is still there. Then I compared the file you sent me with the file that was included in the theme and noticed that the two files match, so there is no difference at all. Did you sent me the wrong file?
    The bug only exists with variable products, for simple products everything works fine.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 24, 2017 at 12:40

    Hello,

    I’ve sent the request to our developers and they say that’s will be fixed in the next theme update.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 24, 2017 at 12:42

    Hmm ok thank you. So, one more issue to hope that the update will be released soon and will really fix the bugs.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 27, 2017 at 15:20

    Hello,

    Please, update theme to the version 3.0.2 It’s available on ThemeForest. This version is compatible with WC 3.0.4.
    I would recommend you before uploading theme files delete “woocommerce” folder, which is located in wp-content/themes/woopress/ to avoid problems with old files.
    Don’t forget to create backup of your files and database before starting update process!
    You need to enter your purchase code to activate our new theme version and skip Setup Wizard.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 28, 2017 at 11:42

    I did so and cleared the cache but the error is still there and the popup plugin still only works for simple products 🙁

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 28, 2017 at 12:04

    Hello,

    Also, you need update all required plugins.
    Please provide us with wp-admin and FTP credentials in private content area.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 28, 2017 at 12:24

    Yeah, updating woocommerce from version 3.0.3 to 3.0.4. fixed the problem with the popup plugin. Thank you!

    Avatar: Royalty
    Royalty
    Participant
    April 28, 2017 at 12:26

    Now there is this error in chrome console, but I dont see any unusual behavior with the zoom:

    zoom.js:24 Uncaught TypeError: Cannot read property 'tn' of undefined
        at e (zoom.js:24)
        at e.load (zoom.js:26)
        at HTMLImageElement.g.onload (zoom.js:24)
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 28, 2017 at 13:07

    Hello,

    As I see, it is not our zoom effect.
    If you haven’t problems with it, you can use this zoom type and ignore the error in console.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    April 28, 2017 at 13:09

    Ok but why isnt it your zoom effect?
    The source is wp-content/themes/royal/js/zoom.js

    Avatar: Royalty
    Royalty
    Participant
    April 29, 2017 at 21:28

    And if I disable zoom in 8theme options, the error is gone.

    Firefox console also shows this error if zoom (window or lens) are activated:
    TypeError: d.dp is undefined
    zoom.js (Line 24, Column 262)

    And I noticed that the single product page loads slower than before and it seams that the zoom is blocking the page from loading. Sometimes the product images are not loaded properly and they are displayed in full size one after the other before they get included in the product gallery slider.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 4, 2017 at 12:39

    Hello,

    Sorry for the delay.
    Provide FTP access, please.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    May 5, 2017 at 09:14

    Please find them in private content. I’ve disabled childtheme and switched to an untouched copy of Royal Theme 3.0.2 to make sure that no custom files affect the theme behavior. The problem with the slow loading images exists only in Firefox. But the error message appears also in Chrome.
    Please dont post any screenshots or links to my page in public content.
    Thank you.

    Please, contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 5, 2017 at 13:03

    Hello,

    Fixed. Please check it now.

    Regards,
    Rose Tyler.

    Avatar: Royalty
    Royalty
    Participant
    May 5, 2017 at 14:12

    Ok great the error message has gone, thank you. You’ve edited only royal/woocommerce/single-product/product-image.php – right?
    Will the next update fix this?

  • 1 2
    Viewing 20 results - 1 through 20 (of 21 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.