phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
570 stars 210 forks source link

Fetch all products of a store #87

Closed VickyFi closed 5 years ago

VickyFi commented 5 years ago

I wrote this snippet in order to fetch all the products of a store:

$productCount = $shopify->Product->count();
$limit = 250;
$totalpage = ceil($productCount/$limit);

for($i=1; $i<=$totalpage; $i++){

  $params = array(
    'limit' => '250',
    'page' => $i
  ); 

  $products = $shopify->Product->get($params);
}

But I am getting only the first 50 products. Do you have any suggestions on how to get them all?

Thanks in advance!

izangi commented 3 years ago

Do you has the solution?