hyttefeber / dawn

Shopify's first source available reference theme, with Online Store 2.0 features and performance built-in.
Other
0 stars 1 forks source link

Infinite scroll on collection pages #39

Open prebenpreben opened 2 years ago

prebenpreben commented 2 years ago

Describe the enhancement you'd like

We want a more smooth way of navigating the site. The goal is to be able to display more products to every user, in a frictionless way that feels meaningful to the user. Adding infinite scroll also makes even more sense after allowing mobile users to browse 4 times faster.

We used to have infinite scroll in the past, and it seemed to work well. However, last time around, we had issues with the url appending the page number in the url, causing confusing if you want to share a collection with others.

Controls/options in the customizer: Automatic - Loads more products, triggered by the scroll itself. Manual w. text. - Adds a "Last flere" button below the current pagination, with option for what text to display. *Off - No infinite scroll.

Describe alternatives you've considered It would be useful to be able to apply different kinds of infinite scroll to different collections to track impact. But, that would make it a setting for the general collection loop, meaning it would need to be applied to every single collection template individually.

Is it possible to apply this as a layered kind of logic?

Meaning: We have a global setting that applies to the default collection pagination for all templates that has not chosen a different option. But also have it as part of the collection loop itself to be able to override the default, global setting. Then, all collection paginations are set to "Default", as default (which uses the global setting in the theme options). But uses a different setting if we choose a different pagination logic for a specific collection.

So in the collection template, options should be: Pagination: Default/Global Automatic Manual w. text. Off

Does that make sense?

It will allow us to apply a global setting to all collections, and then override individual collections on demand, without having to update all our collection templates every single time.

Is specified? No. -> Use global setting. Is specified? Yes. -> Override global setting.

Additional context/screenshots Maybe a screenshot or design?

Ballpark estimate: +/- 5hr (without extra logic)

prebenpreben commented 2 years ago

Update: We also want big pagination buttons as an extra checkbox option. This is critical if we have content below the pagination.

prebenpreben commented 2 years ago

Link to Greg's infinite scroll code: https://github.com/gregjotau/dawn-famme/commit/c3ffb0f9910dd922aad6b717f667d4d62f3752db?fbclid=IwAR30csOci44oRRcZSxuXYC-pRyv4u8jjO8Coi_0dc00JjAihcAmsyvFITGE