Issue with AJAX Infinite Scroll Not Triggering JavaScript Updates

This topic has 1 reply, 1 voice, and was last updated 1 minutes ago ago by saleh

  • 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
    });
  • Viewing 1 results - 1 through 1 (of 1 total)

You must be logged in to reply to this topic.Log in/Sign up

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.