Turning on and off collection product filtering based on in stock / all

Turning on and off collection product filtering based on in stock / all

Tina86
Shopify Partner
4 1 1

Hi, I added in-stock filter button, that when checked displays only in stock products on collections, and when unchecked displays all products. But this is breaking the pagination, and when I tried using infinite scroll  it leaves some unused space between the product grids. Seems like lot of people had the same issue. Any solution/suggestion to fix this.

 

I also tried creating new products array from collection.products with products having stocks > 1, but then array couldn't be paginated.

 

Thanks

Replies 0 (0)