Issue with AJAX Infinite Scroll Not Triggering JavaScript Updates

This topic has 3 replies, 3 voices, and was last updated 3 weeks, 3 days ago ago by Andrew Mitchell

  • Avatar: saleh
    saleh
    Participant
    October 27, 2024 at 12:59

    I’m experiencing an issue with AJAX infinite scrolling in the XStore theme on my WooCommerce shop page. My JavaScript code updates product elements when new items are loaded, but it seems that the infinite scroll functionality does not trigger an event I can hook into. Consequently, my custom JavaScript changes aren’t applied to the newly loaded products.

    Could you please let me know if there’s a specific event or approach I should use to detect when new products are loaded via infinite scroll in XStore? Alternatively, if there’s a recommended solution for ensuring custom JavaScript applies to all dynamically loaded items, I would greatly appreciate any advice. Could you please let me know if there’s a specific event or approach I should use to detect when new products are loaded via infinite scroll in XStore? Alternatively, if there’s a recommended solution for ensuring custom JavaScript applies to all dynamically loaded items, I would greatly appreciate any advice.

    document.addEventListener('ajaxComplete', () => {
      updateProductPrices(); // Reapply price modifications here
    });
    2 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    October 28, 2024 at 17:02

    Dear Saleh,

    We hope this message finds you well.

    You may try using the following events in your implementation:

    
    $(document).on('et_ajax_element_loaded etheme_product_grid_ajax_loaded', function (event, data) {
    
    });
    

    We trust this will be helpful for your needs. Should you require any further assistance, please do not hesitate to reach out.

    Best regards,
    8Theme Team

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    October 31, 2024 at 07:54

    Dear saleh,

    We trust our theme is enhancing your experience. Taking a brief moment to rate it with a glowing 5 stars on ThemeForest would be immensely appreciated. Your feedback holds significant value for us.

    Click here to rate now: https://themeforest.net/downloads

    Thank you sincerely for your ongoing support!

    Best Regards,
    The 8Theme Team

  • Viewing 3 results - 1 through 3 (of 3 total)

The issue related to '‘Issue with AJAX Infinite Scroll Not Triggering JavaScript Updates’' has been successfully resolved, and the topic is now closed for further responses

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