• Hi,

    As per the title. I have WP 6.7.1, WC 9.5.1 and W3 Total Cache 2.8.2 with lazy load images enabled. When selecting a filter (with ajax enabled) the images disappear when the filter is applied. If ajax is disabled, this works without issue.

    KR Mark

Viewing 1 replies (of 1 total)
  • Plugin Author Mainul Hassan

    (@shamimmoeen)

    Hi Mark,

    Thank you for bringing this to our attention.

    After checking, we have identified that the issue is related to the interaction between AJAX filtering and lazy loading with W3 Total Cache. We plan to address this in an upcoming update.

    In the meantime, you can use the below snippet in your child theme’s functions.php file:

    function child_theme_add_lazyload_script() {
    ?>
    <script>
    (function($) {
    $(document).on('wcapf_after_updating_products', function() {
    if (typeof LazyLoad !== 'undefined' && typeof window.lazyLoadOptions !== 'undefined') {
    window.w3tc_lazyload = new LazyLoad(window.lazyLoadOptions);
    } else {
    console.warn('LazyLoad or lazyLoadOptions is not defined.');
    }
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'child_theme_add_lazyload_script', 20);

    Let me know if you need further assistance.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.