Home Forums WoodMart support forum swiper is not defined error in console

swiper is not defined error in console

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #709270

    thomas-8605
    Participant

    Hello,

    we have this error in browser debug console:
    wiper is not defined swiperInit.min.js:1:1203

    Based on this error the lightbox is not working correct. Check also attached screenshot.
    We contact the support of crocoblock and they showing us: Its working perfect with hello theme and with xstore theme.

    If we switch to woodmart the problem is showing again in browser console and lightbox is not working correct.
    We only activate crocoblock in latest version and woodmart core plugins.

    We can see in your forum a lot of users had this issue in the end of last year and you patched this issue.
    Please check that issue and try to fix it again.

    Attachments:
    You must be logged in to view attached files.
    #709272

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    As we can see, you have purposely disabled the Swiper JS library on your website in Theme Settings -> Performance -> JS https://gyazo.com/3f2aaabb7e5ec19d54c375e59af1dab4
    Try to return it to be loaded “On demand” and that should solve the JS error in the console.

    Kind Regards

    #709273

    thomas-8605
    Participant

    Hello,

    we disabled in general now the option ” Advanced scripts controls “.
    But its still not working. We also test the option ALWAYS load… still not working.
    Its only working if we switch to xstore, storefront or hello theme.

    #709276

    Artem Temos
    Keymaster
    Xtemos team

    As we can see, it is not related to our scripts at all. WoodMart has its own version of the product gallery, which replaces WooCommerce’s default one. And because of this, we intentionally remove WooCommerce JS files for performance optimization. As this plugin relies on these libraries, you need to return them to your website. To do this, add the following code snippet to the functions.php file in your child theme

    add_action( 'wp_enqueue_scripts', function () {
    		wp_enqueue_script( 'photoswipe-ui-default' );
    		wp_register_script( 'zoom', plugins_url( 'assets/js/zoom/jquery.zoom.min.js', WC_PLUGIN_FILE ), array(), defined( 'WC_VERSION' ) ? WC_VERSION : '1.0.0', array( 'in_footer' => true ) );
    		wp_enqueue_script( 'zoom' );
    	}, 3000 );
    #709279

    thomas-8605
    Participant

    Hello,

    – We can see exact the same error was in end of 2025 in support forum and you fixing it by a patch.
    Do you plan to fix this issue with a patch in next update?

    – We talked to crocoblock already and they told us: This shoud not handled like this by your theme. This is not only a script for woocommerce products, you also can use it in a simple elementor page or blog post and it shoud work out of the box. Any chance to get it working without this extra snippet like in xstore?

    – In woodmart version 8.3.8 its working great without any custom snippet. That means: you changed the code in the last theme update, correct?

    We need to know that because we can not continoue pay for next woodmart themes if that is an consisent issue and we have to handle all projects in that case with custom snippets.

    #709280

    thomas-8605
    Participant

    and the next problem is:
    by doing this you break with a lot of plugins from crocoblock, they have +900.000 active websites with this plugin.

    Next problem:
    – We have added your snippet to functions.php.
    – We have enabled the arrows via elementor gallery widget.
    But the arrows are not shown in the lightbox.
    If we switch to another theme the arrows are shown in the lightbox without any issue.

    • This reply was modified 4 months, 2 weeks ago by thomas-8605.
    • This reply was modified 4 months, 2 weeks ago by thomas-8605.
    #709324

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    As for now, Crocoblock plugins are not officially compatible with WoodMart. But we are going to integrate these plugins and add full compatibility in the future. As for now, you need to keep this code as a workaround.

    To fix the issue with arrows, please use the following custom CSS code. You can add it to the Custom CSS area in Theme Settings

    .pswp__button--arrow--left, .pswp__button--arrow--right {
    	position: absolute!important;
    }

    Kind Regards

    #709329

    thomas-8605
    Participant

    Hello,

    we have added
    .pswp__button–arrow–left, .pswp__button–arrow–right {
    position: absolute!important;
    }

    to general custom css section and cleaned the rowser cache and elementor cache.
    But the arrows are still not shown in mobile view in lightbox.

    BR
    Tommy

    #709335

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    It seems that it is how the plugin works. Please test how it works with the default theme and send us a screenshot so we can see the difference.

    Kind Regards

Viewing 9 posts - 1 through 9 (of 9 total)