Infinite scroll 进行分面搜索后Bigcommerce无限卷轴不工作

Infinite scroll 进行分面搜索后Bigcommerce无限卷轴不工作,infinite-scroll,bigcommerce,faceted-search,Infinite Scroll,Bigcommerce,Faceted Search,无限滚动到我们的自定义PLP页面仅适用于页面加载。选择分面搜索后,无限滚动功能在添加分面响应后不起作用。请有人帮助我们有无限滚动功能后,面的搜索结果是附加工作 提前感谢BigCommerce默认情况下不提供无限滚动功能,因此我假设您遵循以下指南: 需要记住的是,当应用过滤器时,类别页面会通过AJAX重新加载。对此的修复应该像在this.facetedSearch函数中复制infiniteScroll函数一样简单 在category.js文件中查找以下代码: this.facetedSearch

无限滚动到我们的自定义PLP页面仅适用于页面加载。选择分面搜索后,无限滚动功能在添加分面响应后不起作用。请有人帮助我们有无限滚动功能后,面的搜索结果是附加工作


提前感谢

BigCommerce默认情况下不提供无限滚动功能,因此我假设您遵循以下指南:

需要记住的是,当应用过滤器时,类别页面会通过AJAX重新加载。对此的修复应该像在this.facetedSearch函数中复制infiniteScroll函数一样简单

在category.js文件中查找以下代码:

this.facetedSearch = new FacetedSearch(requestOptions, (content) => {
    $productListingContainer.html(content.productListing);
    $facetedSearchContainer.html(content.sidebar);

    $('html, body').animate({
        scrollTop: 0,
    }, 100);
});
并在此处添加无限滚动功能:

this.facetedSearch = new FacetedSearch(requestOptions, (content) => {
    $productListingContainer.html(content.productListing);
    $facetedSearchContainer.html(content.sidebar);
    function infiniteScroll() {
        const elem = document.querySelector('.productGrid');
        const infScroll = new InfiniteScroll(elem, {
        // options
            path: '.pagination-item--next .pagination-link',
            append: '.product',
            history: false,
         });
         return infScroll;
    }
    infiniteScroll();
    $('html, body').animate({
        scrollTop: 0,
    }, 100);
});