Home Forums WoodMart support forum Infinite scroll issue

Infinite scroll issue

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #698005

    Maxor
    Participant

    Hi

    For archive products, i set “infinites scroll” in the theme settings

    it works

    but from time to time, every 3 days, it doesnt work anymore, and all products are loading on the same page which results in a slow loading as it loads all products from the category (ignoring pagination rules) instead of just showing 12 products then 12 more when scrolling with infinite scrolling

    why is this happening ?

    we have test sites and we have the same problem on test sites

    we cannot share access as those are client tests sites but as we reproduced the issue on test sites you can do the same, what could cause the issue ?

    thank you

    #698073

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards,

    #700502

    Maxor
    Participant

    For some reason the number of products per page in archive products is not taken into account from time to time

    so all products appear on one page, without pagination, resulting in a major performance problem

    it seems woodmart option “posts_per_page” has a problem, is it in a transient ? in a wp post meta ?

    a solution we found to force 12 products per page is the following function :

    add_action( 'pre_get_posts', function( $query ) {
    
        if ( is_admin() || ! $query->is_main_query() ) {
            return;
        }
    
        if ( $query->is_post_type_archive( 'product' ) || $query->is_tax( get_object_taxonomies( 'product' ) ) ) {
    
            $query->set( 'posts_per_page', 12 );
        }
    });
    #700625

    Hello,

    Please deactivate all the 3rd party plugins and activate only theme-required plugins on the site, and then check the issue. I am sure your issue will be solved. Then activate the 3rd party plugins one by one and check which plugin is creating the issue for you.

    Otherwise, if the issue still exists, then keep the 3rd party plugins deactivated and share the WP login details, so I can check and give you a possible solution.

    Best Regards,

    #700633

    Maxor
    Participant

    Of course the first thing we tested is deactivating all 3rd party plugins, but no change, and we have very few 3rd party plugins and very common & safe ones
    it comes from woodmart theme
    we had the same issue on other woodmart sites
    for some reason “posts_per_page” value is not stable
    when this problem occurs, resaving the settings solves it, but then a few days later the issue is back
    so it comes from how woodmart stores the value (transient… or else)

    • This reply was modified 1 month ago by Maxor.
    #700698

    Hello,

    It’s usually caused by server-side caching, not the theme itself. When the cache serves an old version of the query args, the pagination breaks and all products load on one page. Saving the Theme Settings clears that cached value, which is why it works temporarily.

    To fix it permanently, please try the following:
    Clear all layers of cache (server cache, Redis/Object Cache, plugin cache + any CDN).

    Best Regards,

    #700737

    Maxor
    Participant

    There is no cache

    #700799

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards,

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