notrab / headless-dropshipping-starter

Create your own dropshipping store with Next.js, Snipcart & Printful 👕

Home Page:https://headlessdropshipping.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

andy3o0 opened this issue · comments

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

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

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.

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

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

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.

commented

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

#47

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