abdulhannanali / shopify-js-store

Shopify store which uses JavaScript Buy SDK
MIT License
2 stars 2 forks source link

Add pagination for the products at shopify #5

Open abdulhannanali opened 7 years ago

abdulhannanali commented 7 years ago

Shopify is quite limited by the range of products it displays at first, the pagination is necessary in order to display a full range of products we have there in our collection or the complete catalog. By default, it's going to display only the 12 or 13 most recent ones.

One hurdle we face here in order to manage pagination is the structure we need to maintain for it in the state and if there are any changes we are going to make for this structure.

abdulhannanali commented 7 years ago

The data structure range changes can range from just a small change to append the products there are to keep the page number within the state too. The effort we are going to put here in order to make this functionality available makes some rethinking as this is going to be a substantial effort.

abdulhannanali commented 7 years ago

There needs to be some prefetching we need to do here in order to determinate if we can paginate to the next page or not. As the response returned by the Shopify Buy SDK doesn't make us aware of any information regarding this problem. One other thing we can do here is probably writing our own SDK Wrapper, but that would kill the whole purpose of doing this effort.

abdulhannanali commented 7 years ago

Adding pagination is important, as it allows us to test a lot of the functionality, but the way we have designed the functionality right now. It doesn't seem the structure is in it's best shape to allow a feature like this to exist in the current shape.