Home Forums WoodMart support forum Hook on infinate scroll

Hook on infinate scroll

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #698214

    Memoire Agency
    Participant

    Do you provide a hook for when products on the grid in the shop page have loaded, from pagination with infinate loading style?
    For me this does not seem to work
    jQuery(document).on(‘woodmart-ajax-content-reloaded’, function () {
    console.log(‘Woodmart products reloaded via AJAX’);
    });

    #698223

    Artem Temos
    Keymaster

    Hi,

    Yes, there is a JavaScript event fired after products are loaded via Infinite scroll or the Load more button on the shop grid.

    Use this handler:

    $(document).on('wdLoadMoreLoadProducts', function() {
        console.log('Products loaded via infinite scroll');
        // Initialize your scripts here
    });

    This runs after the new products are appended to the grid, so you can safely re-init any custom scripts for newly loaded items.

    Kind Regards

    #699304

    Memoire Agency
    Participant

    Thanks it works perfectly. But it is not triggered when i filter products. Is there a hook to use for all product requests in shop or could you provide me for the hook when products are loaded from filters?

    #699400

    Artem Temos
    Keymaster

    Try to use the following snippet instead

    $(document).on('wdLoadMoreLoadProducts wdShopPageInit', function() {
        console.log('Products loaded via infinite scroll');
        // Initialize your scripts here
    });
Viewing 4 posts - 1 through 4 (of 4 total)