Skip to content
Available for new work

Projects / MagentoMIT · Magento 2.4.7 to 2.4.9

Infinite scroll

AJAX infinite scroll and load-more for Magento 2, on any product list: the category grid, search results, widgets, Page Builder blocks and CMS pages. Free and open source under MIT.

A Magento category page with a product grid
A Magento product grid

catalog-infinite-scroll PHP · MIT · composer require coullworks/module-catalog-infinite-scroll

Replaces the pager on any product list. Shoppers keep scrolling and the next page of products loads in place, with no click and no full page reload. On narrow screens it shows a View more button instead of taking over the scroll.

  • Works on any list: a widget drops it onto Page Builder, CMS pages and static blocks, and one page can run several lists
  • Protects LCP: the default mode never hides your products, and the layout libraries only load when you pick one
  • Calls nothing external: every library ships inside the module, so there’s no CDN and no CSP exception
  • Analytics-aware: each page it loads sends a GA4 virtual pageview

Before you install it

What it does, and what it leaves alone

What it covers

  • Category and search result pages, attached automatically once it’s enabled
  • Any other list through the Infinite Scroll widget: Page Builder rows, CMS pages, static blocks and layout XML
  • AJAX layered navigation: when a filter swaps the product list, it re-attaches to the new one on its own
  • Masonry, Isotope and Packery layouts, each loaded only when you choose it
  • Per store view settings, all in the admin
  • Magento Open Source and Adobe Commerce 2.4.7, 2.4.8 and 2.4.9, on PHP 8.2 to 8.5, including PHP 8.5 for Magento 2.4.9 in production.

What it does not

  • It doesn’t change how products are sorted, filtered or priced
  • It doesn’t add products to the page that your theme’s pager wouldn’t: it follows the same next link
  • Themes that replace the product list with their own JavaScript, such as some PWA front ends, need the selectors set by hand
A Magento store’s category page

Every setting, in the admin

Stores, Configuration, CoullWorks, Catalog Infinite Scroll. Everything below is set per store view, and none of it needs code.

Latest release
v2.0.2
Licence
MIT
  • Load on scroll, or on a buttonLoad as shoppers near the bottom, or only when they press View more, with the distance from the bottom you choose
  • The address bar follows alongEach page loaded updates the URL, so a shared or refreshed link lands where the shopper was
  • GA4 virtual pageviewsEach page loaded is counted in GA4 (gtag) or the older analytics.js, so reports don’t lose the pages people scrolled through
  • Your theme’s own markupContainer, item and next-link selectors, so it fits a custom theme without template changes
  • The pager and the end of the listHide the original pager once scrolling takes over, and show a loading state and an end-of-list message
  • Layout modeYour theme’s grid, or Masonry, Isotope or Packery, with the grid revealed only once images are measured

How do I install it?

With Composer: composer require coullworks/module-catalog-infinite-scroll, then bin/magento module:enable CoullWorks_CatalogInfiniteScroll, bin/magento setup:upgrade and bin/magento cache:flush. In production mode, run setup:di:compile and setup:static-content:deploy as well. Then switch it on under Stores, Configuration, CoullWorks.

Which Magento versions does it run on?

Magento Open Source and Adobe Commerce 2.4.7, 2.4.8 and 2.4.9, on PHP 8.2 to 8.5, including PHP 8.5 for Magento 2.4.9 in production.

Is infinite scroll bad for SEO?

It can be, when the pages behind the scroll have no addresses of their own. This module follows your store’s existing pager: the next links stay in the page’s HTML, and the address bar changes to each page’s own URL as it loads. So every page of products still has a real address a search engine can crawl, the same as before.

Will it slow the page down?

Not in the default mode. Nothing extra loads before the page renders, the product grid is never hidden, and the Masonry, Isotope and Packery libraries only download when you choose one of those layouts. Largest Contentful Paint is untouched.

Does it work with AJAX layered navigation?

Yes. When a filter replaces the product list without a full page load, the module notices the new list and attaches to it, with no theme changes or extension-specific code.

Can I use it on a list that isn’t the category page?

Yes. Add the Infinite Scroll (CoullWorks) widget in Page Builder, a CMS page, a static block or layout XML, and point it at the list’s container, item and next-link selectors. One page can run several lists independently.

What does it cost?

Nothing. It’s open source under the MIT licence, so you can use it, change it and ship it on client stores. If you want it fitted to a custom theme or a headless front end, that’s a small piece of work I can quote for.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.