can't get infinite scroll to work on woo

I am using the plugin: https://wordpress.org/plugins/malinky-ajax-pagination/
I entered all the things in the settings for the woo pages, but it's still not working. What am I getting wrong?

  • Adam Czajczyk

    Hello Jonathan,

    I hope you're well today and thank you for your question!

    I used the support access that you granted to check your site and I noticed that some resources are protected with .htaccess password, even when I'm logged in to the site.

    I'm not sure whether it's a part of an issue or not but it certainly doesn't let my browser load the site fully and breaks execution of some scripts, thus making it impossible to test and investigate.

    That said, would you mind either removing that protection? It's possible that this alone may fix the issue but even if it doesn't, it will let me check the site.

    Let me know here when I can access the site again to check it without that protection, please.

    Best regards,
    Adam

  • Dimitris

    Hey there Jonathan,

    hope you're doing good and please excuse our late response here, it's been quite hectic in our forums lately!

    I just went ahead and inspected your admin pages and noticed that you deactivate "Ajax Pagination and Infinite Scroll" plugin. Are you still require assistance on this? Please advise!
    If so, could you please activate it for us, just in case something goes wrong, and let us know in order to dig in! :slight_smile:

    Take care,
    Dimitris

  • Dimitris

    Hey there Jonathan,

    I just went in and I think this is working fine now! I tested the main shop page, a category archive and a tag archive as well.

    The only thing that should be changed, is the loader spinner graphic when new products are being loaded. This is being displayed where the normal pagination links are, in your case above the products list, so if you scroll down to trigger the infinite scroll event, despite that this is working the spinner is "invisible" as it's being displayed just after the navigation items which by the way are being hidden by the plugin. An easy workaround could be to change this template and move navigation links below products list. :wink:

    Warm regards,
    Dimitris

  • Adam Czajczyk

    Hello Jonathan!

    "Inifinite scroll" kind of scripts are usually causing high load on the site unfortunately. It would probably be better to implement that on a theme level so the WP loop code would be also properly altered but that would be a custom coding and would most likely require either creation of an advanced child-theme or even writing a new theme from scratch.

    As for the spinner. The solution would be to create a child-theme (if you are not using it yet) and then copy necessary template files from parent theme to a child theme.

    Then, inside these files you would find something like:

    <div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div>
    <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>

    and that should be moved below the WP loop. That's actually a basic rule and it may look different on your site. I took another look at it so let me give you an example for product archive (list of products) page:

    1. the template file seems to be "archive-product.php" so this one should be copied to a child theme folder

    2. Inside there's this code:

    <nav class="category-meta col-sm-7 col-md-7 bottom navigation pagination">
    					<?php woocommerce_pagination(); ?>
    </nav> <!-- end category-meta -->

    3. Moving that block of code down so it would be located under this one should help:

    <?php woocommerce_product_loop_end(); ?>

    Similar changes should be made to other files relevant to the pages where the infinite scrolling is used.

    I hope that helps!

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.