notrab / headless-dropshipping-starter

Create your own dropshipping store with Next.js, Snipcart & Printful 👕
https://headlessdropshipping.com
723 stars 135 forks source link

help me it's only fetching the first 20 products. #66

Closed andy3o0 closed 2 years ago

andy3o0 commented 2 years ago

help me it's only fetching the first 20 products.

andy3o0 commented 2 years ago

Kindly help I need to deliver it to the client :(

notrab commented 2 years ago

Hey @andy3o0

Do you see anything in the response? I'd take a look at the Printful API docs to see if they accept a pagination param that you can adjust.

andy3o0 commented 2 years ago

thanks for responding, I have 51 products added in printful. I console log the products it's fetching on the index page. The array shows the length of the first 20 products only. I am not an expert programmer. :( @notrab

andy3o0 commented 2 years ago

https://www.loom.com/share/e7fa3bda61fd4b56a9056c4e89e04a17

@notrab

tzbodula commented 2 years ago

I'm having this same issue, the get request is only getting 20 of my 35 products. Not really sure how to fix this

notrab commented 2 years ago

I will try to replicate this and support further. In the meantime I’d suggest looking at the products that come back from printful and see if the products are being paginated correctly inside the code for the index page props.

JBenAnderson commented 2 years ago

Hi first off great project and resource thanks @notrab! I see no one has responded to this issue yet and wanted to say that I ran into this same problem with only returning 20 products and found a fix.

I was able to increase the size by adding a parameter within the printful-request get statement near the bottom of index.tsx to set limit to 100 (which I believe is the max amount not sure). This will return up to 100 products on your page at a time.

Screen Shot 2022-07-31 at 5 10 59 PM
pythlang commented 2 years ago

https://github.com/notrab/headless-dropshipping-starter/issues/47

This question was already answered thoroughly here. We should mark this as closed.